Nir Soffer has posted comments on this change.

Change subject: qemuimg: Introduce InvalidOutput exception
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/65208/1/lib/vdsm/qemuimg.py
File lib/vdsm/qemuimg.py:

Line 67: 
Line 68: class InvalidOutput(QImgError):
Line 69:     """
Line 70:     Raised when the command output is not valid.
Line 71:     """
We can do this ugly hack to make sure that no client fail to get ecode and 
stderr attributes from this subclass:

    ecode = 0
    stderr = ""

A better design would probably be to inherit from qemuimg.Error, and have two 
different sub classes, inheriting nothing from the base class.

    class Error(Exception):
        """ Base class for qemuimg errors """

    CommandFailed(Error):
        def __init__(self, msg, cmd, rc, out, err):
            ...

    InvalidOutput(Error):
        def __init__(self, msg, cmd, out):
           ...

This require changing callers to check for qemuimg.Error.
Line 72: 
Line 73:     def __init__(self, cmd, stdout, message):
Line 74:         self.cmd = cmd
Line 75:         self.stdout = stdout


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If3f801f05f130c2417e4946877e31030260269a1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <ah...@redhat.com>
Gerrit-Reviewer: Ala Hino <ah...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to