Ala Hino has uploaded a new change for review.
Change subject: qemuimg: Add the command to QImgError ......................................................................
qemuimg: Add the command to QImgError
Change-Id: I226a54b29ae4afc3854056efea78767383b89619 Signed-off-by: Ala Hino ahino@redhat.com --- M lib/vdsm/qemuimg.py 1 file changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/65179/1
diff --git a/lib/vdsm/qemuimg.py b/lib/vdsm/qemuimg.py index c9e72ec..26d0ec1 100644 --- a/lib/vdsm/qemuimg.py +++ b/lib/vdsm/qemuimg.py @@ -53,15 +53,16 @@
class QImgError(Exception): - def __init__(self, ecode, stdout, stderr, message=None): + def __init__(self, cmd, ecode, stdout, stderr, message=None): + self.cmd = cmd self.ecode = ecode self.stdout = stdout self.stderr = stderr self.message = message
def __str__(self): - return "ecode=%s, stdout=%s, stderr=%s, message=%s" % ( - self.ecode, self.stdout, self.stderr, self.message) + return "cmd=%s, ecode=%s, stdout=%s, stderr=%s, message=%s" % ( + self.cmd, self.ecode, self.stdout, self.stderr, self.message)
def info(image, format=None): @@ -344,5 +345,5 @@ def _run_cmd(cmd, cwd=None): rc, out, err = commands.execCmd(cmd, raw=True, cwd=cwd) if rc != 0: - raise QImgError(rc, out, err) + raise QImgError(cmd, rc, out, err) return out
gerrit-hooks has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 1:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Nir Soffer has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 1: Code-Review+2
gerrit-hooks has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 2:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Nir Soffer has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 2:
(1 comment)
https://gerrit.ovirt.org/#/c/65179/2/lib/vdsm/qemuimg.py File lib/vdsm/qemuimg.py:
Line 279: raise exception.ActionStopped() Line 280: Line 281: cmdutils.retcode_log_line(self._command.returncode, self.error) Line 282: if self._command.returncode != 0: Line 283: raise QImgError(self._command, self._command.returncode, "", _commnad is a CPopen instance, not a list or arguments.
This is not your fault, this name is very bad. Please review this series fixing this issue: https://gerrit.ovirt.org/#/q/status:open+project:vdsm+branch:master+topic:pr... Line 284: self.error) Line 285: Line 286: def wait_for_completion(self): Line 287: timeout = config.getint("irs", "progress_interval")
Ala Hino has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 2:
(1 comment)
how do I get the cmd from the CPopen instance?
gerrit-hooks has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 3:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Nir Soffer has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 3:
(1 comment)
https://gerrit.ovirt.org/#/c/65179/3/lib/vdsm/qemuimg.py File lib/vdsm/qemuimg.py:
Line 218 Line 219 Line 220 Line 221 Line 222 You want to save the wrapped command, not the original.
gerrit-hooks has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 4:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Ala Hino has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 3:
(1 comment)
https://gerrit.ovirt.org/#/c/65179/3/lib/vdsm/qemuimg.py File lib/vdsm/qemuimg.py:
Line 218 Line 219 Line 220 Line 221 Line 222
You want to save the wrapped command, not the original.
Done
Nir Soffer has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 4:
Please make pep8 tool happy:
23:29:30 ./lib/vdsm/qemuimg.py:100:80: E501 line too long (81 > 79 characters) 23:29:30 ./lib/vdsm/qemuimg.py:155:80: E501 line too long (83 > 79 characters) 23:29:30 ./lib/vdsm/qemuimg.py:224:37: E128 continuation line under-indented for visual indent 23:29:30 ./lib/vdsm/qemuimg.py:225:37: E128 continuation line under-indented for visual indent
Nir Soffer has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 4: Code-Review+1
gerrit-hooks has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 5:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Nir Soffer has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 5: Code-Review+1
(2 comments)
Looks good, just minor indentation issue.
https://gerrit.ovirt.org/#/c/65179/4/lib/vdsm/qemuimg.py File lib/vdsm/qemuimg.py:
Line 219: self._aborted = False Line 220: self._progress = 0.0 Line 221: Line 222: self._stdout = bytearray() Line 223: self._stderr = bytearray() Please move cmd to next line... Line 224: Line 225: self.cmd = cmdutils.wrap_command(cmd, Line 226: with_nice=utils.NICENESS.HIGH, Line 227: with_ioclass=utils.IOCLASS.IDLE)
https://gerrit.ovirt.org/#/c/65179/5/lib/vdsm/qemuimg.py File lib/vdsm/qemuimg.py:
Line 223: self._stderr = bytearray() Line 224: Line 225: self.cmd = cmdutils.wrap_command(cmd, Line 226: with_nice=utils.NICENESS.HIGH, Line 227: with_ioclass=utils.IOCLASS.IDLE) And indent all the params one per line, starting at column 5. Line 228: _log.debug(cmdutils.command_log_line(self.cmd, cwd=cwd)) Line 229: self._command = CPopen(self.cmd, cwd=cwd, Line 230: deathSignal=signal.SIGKILL) Line 231: self._stream = utils.CommandStream(
gerrit-hooks has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 6:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Ala Hino has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 5:
(1 comment)
https://gerrit.ovirt.org/#/c/65179/5/lib/vdsm/qemuimg.py File lib/vdsm/qemuimg.py:
Line 223: self._stderr = bytearray() Line 224: Line 225: self.cmd = cmdutils.wrap_command(cmd, Line 226: with_nice=utils.NICENESS.HIGH, Line 227: with_ioclass=utils.IOCLASS.IDLE)
And indent all the params one per line, starting at column 5.
Done Line 228: _log.debug(cmdutils.command_log_line(self.cmd, cwd=cwd)) Line 229: self._command = CPopen(self.cmd, cwd=cwd, Line 230: deathSignal=signal.SIGKILL) Line 231: self._stream = utils.CommandStream(
Ala Hino has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 6: Verified+1
Nir Soffer has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 6: Code-Review+1
Waiting for Adam review.
Nir Soffer has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 6: Code-Review+2
Nir Soffer has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 6:
Lets move faster, If Adam has issues with this we will enhance this later.
Nir Soffer has submitted this change and it was merged.
Change subject: qemuimg: Add the command to QImgError ......................................................................
qemuimg: Add the command to QImgError
Change-Id: I226a54b29ae4afc3854056efea78767383b89619 Signed-off-by: Ala Hino ahino@redhat.com Reviewed-on: https://gerrit.ovirt.org/65179 Continuous-Integration: Jenkins CI Reviewed-by: Nir Soffer nsoffer@redhat.com --- M lib/vdsm/qemuimg.py 1 file changed, 25 insertions(+), 18 deletions(-)
Approvals: Nir Soffer: Looks good to me, approved Jenkins CI: Passed CI tests Ala Hino: Verified
gerrit-hooks has posted comments on this change.
Change subject: qemuimg: Add the command to QImgError ......................................................................
Patch Set 7:
* Update tracker: IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org