1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

Fix bridge deletion

Ticket: CM-3346
Reviewed By:
Testing Done: Tested bridge up/down
This commit is contained in:
Roopa Prabhu
2014-10-13 10:07:36 -07:00
parent 61636dcc1c
commit c2d55ff5f2

View File

@@ -150,6 +150,27 @@ class ifaceScheduler():
not ifupdownobj.ALL)):
return True
if ifaceobj.type == ifaceType.BRIDGE:
#
# XXX: This function's job is to return True for
# logical devices when any of the upperifaces are still around.
# In the new model, where bridge is represented as a dependency
# for a bridge port, bridge becomes a lowerdevice of a bridge port,
# which is not really true. To handle this case, add a special
# check for bridge device. Will figure out a better way to handle
# this.
# Long term this function should be replaced by
# walking the sysfs links to upper and lower device available in
# latest kernels.
try:
if os.listdir('/sys/class/net/%s/brif' %ifaceobj.name):
return False
else:
return True
except Exception:
pass
return True
ulist = ifaceobj.upperifaces
if not ulist:
return True