mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
Fix a few ordering issues + fix following upperiface for bridge device
Ticket: CM-3346 Reviewed By: Testing Done: sanity test
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
pre-up,ifenslave
|
pre-up,ifenslave
|
||||||
pre-up,bridge
|
|
||||||
pre-up,bridgevlanaware
|
|
||||||
pre-up,mstpctl
|
|
||||||
pre-up,vlan
|
pre-up,vlan
|
||||||
pre-up,vxlan
|
pre-up,vxlan
|
||||||
pre-up,usercmds
|
pre-up,usercmds
|
||||||
pre-up,loopback
|
pre-up,loopback
|
||||||
|
pre-up,bridgevlanaware
|
||||||
|
pre-up,bridge
|
||||||
|
pre-up,mstpctl
|
||||||
up,dhcp
|
up,dhcp
|
||||||
up,address
|
up,address
|
||||||
up,addressvirtual
|
up,addressvirtual
|
||||||
@@ -18,9 +18,9 @@ down,dhcp
|
|||||||
down,addressvirtual
|
down,addressvirtual
|
||||||
down,address
|
down,address
|
||||||
down,usercmds
|
down,usercmds
|
||||||
|
post-down,mstpctl
|
||||||
post-down,bridgevlanaware
|
post-down,bridgevlanaware
|
||||||
post-down,bridge
|
post-down,bridge
|
||||||
post-down,mstpctl
|
|
||||||
post-down,vxlan
|
post-down,vxlan
|
||||||
post-down,vlan
|
post-down,vlan
|
||||||
post-down,ifenslave
|
post-down,ifenslave
|
||||||
|
@@ -197,6 +197,20 @@ class ifupdownMain(ifupdownBase):
|
|||||||
def get_iface_obj_last(self, ifacename):
|
def get_iface_obj_last(self, ifacename):
|
||||||
return self.ifaceobjdict.get(ifacename)[-1]
|
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,
|
def create_n_save_ifaceobj(self, ifacename, priv_flags=None,
|
||||||
increfcnt=False):
|
increfcnt=False):
|
||||||
""" creates a iface object and adds it to the iface dictionary """
|
""" creates a iface object and adds it to the iface dictionary """
|
||||||
|
@@ -99,6 +99,7 @@ class ifaceScheduler():
|
|||||||
# minor optimization. If operation is 'down', proceed only
|
# minor optimization. If operation is 'down', proceed only
|
||||||
# if interface exists in the system
|
# if interface exists in the system
|
||||||
ifacename = ifaceobjs[0].name
|
ifacename = ifaceobjs[0].name
|
||||||
|
ifupdownobj.logger.info('%s: running ops ...' %ifacename)
|
||||||
if ('down' in ops[0] and ifaceobjs[0].type != ifaceType.BRIDGE_VLAN and
|
if ('down' in ops[0] and ifaceobjs[0].type != ifaceType.BRIDGE_VLAN and
|
||||||
not ifupdownobj.link_exists(ifacename)):
|
not ifupdownobj.link_exists(ifacename)):
|
||||||
ifupdownobj.logger.debug('%s: does not exist' %ifacename)
|
ifupdownobj.logger.debug('%s: does not exist' %ifacename)
|
||||||
@@ -356,7 +357,7 @@ class ifaceScheduler():
|
|||||||
#
|
#
|
||||||
# Run any upperifaces if available
|
# Run any upperifaces if available
|
||||||
#
|
#
|
||||||
followupperifaces = []
|
followupperifaces = False
|
||||||
run_queue = []
|
run_queue = []
|
||||||
skip_ifacesort = int(ifupdownobj.config.get('skip_ifacesort', '0'))
|
skip_ifacesort = int(ifupdownobj.config.get('skip_ifacesort', '0'))
|
||||||
if not skip_ifacesort and not indegrees:
|
if not skip_ifacesort and not indegrees:
|
||||||
@@ -368,6 +369,8 @@ class ifaceScheduler():
|
|||||||
# If there is any interface that does exist, maybe it is a
|
# If there is any interface that does exist, maybe it is a
|
||||||
# logical interface and we have to followupperifaces when it
|
# logical interface and we have to followupperifaces when it
|
||||||
# comes up, so get that list.
|
# comes up, so get that list.
|
||||||
|
if any([True for i in ifacenames
|
||||||
|
if ifupdownobj.must_follow_upperifaces(i)]):
|
||||||
followupperifaces = (True if
|
followupperifaces = (True if
|
||||||
[i for i in ifacenames
|
[i for i in ifacenames
|
||||||
if not ifupdownobj.link_exists(i)]
|
if not ifupdownobj.link_exists(i)]
|
||||||
|
Reference in New Issue
Block a user