Francesco Romani has posted comments on this change.

Change subject: lib: utils: consolidate Error class in one place
......................................................................


Patch Set 5:

(1 comment)

https://gerrit.ovirt.org/#/c/47964/5/lib/vdsm/cmdutils.py
File lib/vdsm/cmdutils.py:

Line 29: 
Line 30: 
Line 31: class Error(Exception):
Line 32: 
Line 33:     def __init__(self, rc, out, err):
> Since this is a common error, we need now more context about the failure.
Done in patch https://gerrit.ovirt.org/48628

I now see that we have a pattern:

    # do other stuff, build `command`

    rc, out, err = utils.execCmd(command, ...)

    if rc != 0:
        raise cmdutils.Error(command, rc, out, err)

    # continue as usual

it would be much nicer and friendlier to wrap this in an utility helper. 
execCmd is already too bulky, so I wonder how properly do that.

Maybe some kind of magic decorator wrapper around execCmd?
Line 34:         self.rc = rc
Line 35:         self.out = out
Line 36:         self.err = err
Line 37: 


-- 
To view, visit https://gerrit.ovirt.org/47964
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia490c055e6e5c637eba82ccffb9d2dfc748db8f5
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpoled...@redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzama...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczew...@gmail.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to