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