Francesco Romani has uploaded a new change for review. Change subject: WIP ......................................................................
WIP Change-Id: I0beb75cc1d4a09b07402d16e4b8057e391daad8c Signed-off-by: Francesco Romani <from...@redhat.com> --- M lib/vdsm/taskset.py M lib/vdsm/udevadm.py M lib/vdsm/utils.py M lib/vdsm/virtsparsify.py 4 files changed, 11 insertions(+), 15 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/47967/1 diff --git a/lib/vdsm/taskset.py b/lib/vdsm/taskset.py index 2ec6a16..c33c6cf 100644 --- a/lib/vdsm/taskset.py +++ b/lib/vdsm/taskset.py @@ -37,10 +37,7 @@ """ command = [constants.EXT_TASKSET, '--pid', str(pid)] - rc, out, err = utils.execCmd(command, resetCpuAffinity=False) - - if rc != 0: - raise Error(rc, out, err) + utils.exec_cmd(command, resetCpuAffinity=False) return _cpu_set_from_output(out[-1]) @@ -65,10 +62,7 @@ str(pid) )) - rc, out, err = utils.execCmd(command, resetCpuAffinity=False) - - if rc != 0: - raise Error(rc, out, err) + utils.exec_cmd(command, resetCpuAffinity=False) def _cpu_set_from_output(line): diff --git a/lib/vdsm/udevadm.py b/lib/vdsm/udevadm.py index e4e3a9c..dd13120 100644 --- a/lib/vdsm/udevadm.py +++ b/lib/vdsm/udevadm.py @@ -100,6 +100,4 @@ def _run_command(args): cmd = [_UDEVADM.cmd] cmd.extend(args) - rc, out, err = utils.execCmd(cmd, raw=True) - if rc != 0: - raise Error(rc, out, err) + utils.exec_cmd(cmd, raw=True) diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py index d16f059..e447529 100644 --- a/lib/vdsm/utils.py +++ b/lib/vdsm/utils.py @@ -687,6 +687,13 @@ self.rc, self.out, self.err) +def exec_cmd(cmd, *a, **kw): + rc, out, err = execCmd(cmd, *a, **kw) + if rc != 0: + raise Error(rc, out, err) + return rc, out, err + + def stripNewLines(lines): return [l[:-1] if l.endswith('\n') else l for l in lines] diff --git a/lib/vdsm/virtsparsify.py b/lib/vdsm/virtsparsify.py index 187e3bd..35099dc 100644 --- a/lib/vdsm/virtsparsify.py +++ b/lib/vdsm/virtsparsify.py @@ -50,7 +50,4 @@ cmd.extend((src_vol, dst_vol)) - rc, out, err = utils.execCmd(cmd, deathSignal=signal.SIGKILL) - - if rc != 0: - raise Error(rc, out, err) + utils.exec_cmd(cmd, deathSignal=signal.SIGKILL) -- To view, visit https://gerrit.ovirt.org/47967 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0beb75cc1d4a09b07402d16e4b8057e391daad8c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches