Change in vdsm[master]: tc: make TCException more accessible programmatically
Dan Kenigsberg has uploaded a new change for review. Change subject: tc: make TCException more accessible programmatically .. tc: make TCException more accessible programmatically Change-Id: I110fd34ea36e773fc46019e0ef1af79bb795a44f Signed-off-by: Dan Kenigsberg dan...@redhat.com --- M vdsm/tc.py 1 file changed, 5 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/7433/1 diff --git a/vdsm/tc.py b/vdsm/tc.py index ddf7281..1bb38d1 100644 --- a/vdsm/tc.py +++ b/vdsm/tc.py @@ -18,20 +18,20 @@ # Refer to the README and COPYING files for full details of the license # -from subprocess import list2cmdline from collections import namedtuple import storage.misc from vdsm.constants import EXT_TC, EXT_IFCONFIG ERR_DEV_NOEXIST = 2 -PROC_ERROR_MSG = 'error executing command %s error: %s' + class TrafficControlException(Exception): -def __init__(self, errCode, message): +def __init__(self, errCode, message, command): self.errCode = errCode self.message = message -Exception.__init__(self, self.errCode, self.message) +self.command = command +Exception.__init__(self, self.errCode, self.message, self.command) def setPortMirroring(network, target): qdisc_add_ingress(network) @@ -49,8 +49,7 @@ def _process_request(command): retcode, out, err = storage.misc.execCmd(command, raw=True, sudo=False) if retcode != 0: -msg = PROC_ERROR_MSG % (list2cmdline(command), err) -raise TrafficControlException(retcode, msg) +raise TrafficControlException(retcode, err, command) return out def qdisc_add_ingress(dev): -- To view, visit http://gerrit.ovirt.org/7433 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I110fd34ea36e773fc46019e0ef1af79bb795a44f Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg dan...@redhat.com ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: tc: make TCException more accessible programmatically
Antoni Segura Puimedon has posted comments on this change. Change subject: tc: make TCException more accessible programmatically .. Patch Set 1: Verified; Looks good to me, but someone else must approve It is cleaner and richer this way. -- To view, visit http://gerrit.ovirt.org/7433 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I110fd34ea36e773fc46019e0ef1af79bb795a44f Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegu...@redhat.com ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: tc: make TCException more accessible programmatically
oVirt Jenkins CI Server has posted comments on this change. Change subject: tc: make TCException more accessible programmatically .. Patch Set 1: Build Successful http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/625/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/7433 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I110fd34ea36e773fc46019e0ef1af79bb795a44f Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegu...@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: tc: make TCException more accessible programmatically
Dan Kenigsberg has submitted this change and it was merged. Change subject: tc: make TCException more accessible programmatically .. tc: make TCException more accessible programmatically Change-Id: I110fd34ea36e773fc46019e0ef1af79bb795a44f Signed-off-by: Dan Kenigsberg dan...@redhat.com --- M vdsm/tc.py 1 file changed, 5 insertions(+), 6 deletions(-) Approvals: Antoni Segura Puimedon: Verified; Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/7433 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I110fd34ea36e773fc46019e0ef1af79bb795a44f Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegu...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches