Change in vdsm[master]: Enhance output of vdsm-tool

nsoffer at redhat.com nsoffer at redhat.com
Sun Mar 23 09:08:03 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: Enhance output of vdsm-tool
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

The real fix is getting rid of the RuntimeError and using specific error for expected errors. Handling SystemExit and KeyboardInterrupt is also missing.

http://gerrit.ovirt.org/#/c/25767/2/vdsm-tool/vdsm-tool
File vdsm-tool/vdsm-tool:

Line 151: return
What we need here is a specific exception handler for command expected errors. These are the errors we expect and have nice help message.

So what should be here is something like:

    except KnownIssue as e:
        print >> sys.stderr, e

Assuming all the commands raise this error (instead of RuntimeError).

Then we need an exception handler for SystemExit and KeyboardInterrupt. In this case, we never want to show a traceback, but we would like to print something like:

    interrupted

Or:

    terminated

So we can detect that a user interrupted the command when a user report an issue.


Line 152: Exception
This will make it impossible to debug unexpected failures. Practically, you will have to go and disable this exception handler to get the traceback to fix such errors.

But we can also remove this handler, as by default, Python will write a traceback to stderr, and exit with error code 1.


-- 
To view, visit http://gerrit.ovirt.org/25767
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If89b605550f141fe2b7ab273c5824f0aa3a2e6e1
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list