def get_iface_obj_last(self, ifacename):
return self.ifaceobjdict.get(ifacename)[-1]
+ def must_follow_upperifaces(self, ifacename):
+ #
+ # XXX: This bleeds the knowledge of iface
+ # types in the infrastructure module.
+ # Cant think of a better fix at the moment.
+ # In future maybe the module can set a flag
+ # to indicate if we should follow upperifaces
+ #
+ ifaceobj = self.get_ifaceobj_first(ifacename)
+ if (ifaceobj.type == ifaceType.BRIDGE or
+ ifaceobj.type == ifaceType.BRIDGE_VLAN):
+ return False
+ return True
+
def create_n_save_ifaceobj(self, ifacename, priv_flags=None,
increfcnt=False):
""" creates a iface object and adds it to the iface dictionary """
# minor optimization. If operation is 'down', proceed only
# if interface exists in the system
ifacename = ifaceobjs[0].name
+ ifupdownobj.logger.info('%s: running ops ...' %ifacename)
if ('down' in ops[0] and ifaceobjs[0].type != ifaceType.BRIDGE_VLAN and
not ifupdownobj.link_exists(ifacename)):
ifupdownobj.logger.debug('%s: does not exist' %ifacename)
#
# Run any upperifaces if available
#
- followupperifaces = []
+ followupperifaces = False
run_queue = []
skip_ifacesort = int(ifupdownobj.config.get('skip_ifacesort', '0'))
if not skip_ifacesort and not indegrees:
# If there is any interface that does exist, maybe it is a
# logical interface and we have to followupperifaces when it
# comes up, so get that list.
- followupperifaces = (True if
+ if any([True for i in ifacenames
+ if ifupdownobj.must_follow_upperifaces(i)]):
+ followupperifaces = (True if
[i for i in ifacenames
if not ifupdownobj.link_exists(i)]
else False)