Bug 720591

Summary: Some bkr commands always exit with status 0
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: command lineAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: low    
Version: 0.6CC: bpeck, dcallagh, mcsontos, rmancy, stl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-12 02:43:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dan Callaghan 2011-07-12 07:48:28 UTC
These are the ones I've noticed:

* distros-edit-version
* job-cancel
* task-add

It might be worth checking each of the bkr commands and making sure their exit status is always sensible and indicative of errors.

Comment 1 Dan Callaghan 2011-07-25 05:31:15 UTC
This snippet from kobo.cli.CommandOptionParser is problematic:

    def run(self, args=None, values=None):
        """parse arguments and run a command"""
        cmd, cmd_opts, cmd_args = self.parse_args(args, values)
        cmd_kwargs = cmd_opts.__dict__
        try:
            cmd.run(*cmd_args, **cmd_kwargs)
        except Fault, ex:
            print "Exception: %s" % ex.faultString
        except Exception, ex:
            raise
            print "Exception: %s" % ex

This is the method we eventually call to do all the work when bkr is invoked. So whenever we get an XMLRPC fault, the error is printed to stdout and then discarded, leaving us with an exit status of 0.