Change in vdsm[master]: Added errno.ENOTSUP to excepted tc error codes

ibarkan at redhat.com ibarkan at redhat.com
Tue Jan 6 08:27:35 UTC 2015


Ido Barkan has uploaded a new change for review.

Change subject: Added errno.ENOTSUP to excepted tc error codes
......................................................................

Added errno.ENOTSUP to excepted tc error codes

On RHEL 7, when removing a non existent tc object an ENOTSUP
is returned instead of ENOENT or EINVAL.

Change-Id: I7586efb2929e4356bf09bdd6d15a45e489da5635
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
---
M vdsm/network/configurators/qos.py
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/36601/1

diff --git a/vdsm/network/configurators/qos.py b/vdsm/network/configurators/qos.py
index d9ec461..af370af 100644
--- a/vdsm/network/configurators/qos.py
+++ b/vdsm/network/configurators/qos.py
@@ -53,11 +53,13 @@
     vlan_tag = models.hierarchy_vlan_tag(top_device)
     device = models.hierarchy_backing_device(top_device).name
     class_id = '%x' % (_NON_VLANNED_ID if vlan_tag is None else vlan_tag)
+    missing_object_error_codes = (errno.EINVAL, errno.ENOENT, errno.ENOTSUP)
+
     try:
         tc.filter.delete(
             device, pref=_NON_VLANNED_ID if vlan_tag is None else vlan_tag)
     except tc.TrafficControlException as tce:
-        if tce.errCode not in (errno.EINVAL, errno.ENOENT):  # No filter exists
+        if tce.errCode not in missing_object_error_codes:  # No filter exists
             raise
 
     device_qdiscs = list(tc._qdiscs(device))
@@ -67,7 +69,7 @@
     try:
         tc.cls.delete(device, classid=root_qdisc_handle + class_id)
     except tc.TrafficControlException as tce:
-        if tce.errCode not in (errno.EINVAL, errno.ENOENT):  # No class exists
+        if tce.errCode not in missing_object_error_codes:  # No class exists
             raise
 
     if not _uses_classes(device, root_qdisc_handle=root_qdisc_handle):
@@ -75,7 +77,7 @@
             tc._qdisc_del(device)
             tc._qdisc_del(device, kind='ingress')
         except tc.TrafficControlException as tce:
-            if tce.errCode not in (errno.EINVAL, errno.ENOENT):  # No qdisc
+            if tce.errCode not in missing_object_error_codes:  # No qdisc
                 raise
 
 


-- 
To view, visit http://gerrit.ovirt.org/36601
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7586efb2929e4356bf09bdd6d15a45e489da5635
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>


More information about the vdsm-patches mailing list