]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
Fix a few ordering issues + fix following upperiface for bridge device
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Fri, 10 Oct 2014 21:05:19 +0000 (14:05 -0700)
committerRoopa Prabhu <roopa@cumulusnetworks.com>
Fri, 10 Oct 2014 21:05:19 +0000 (14:05 -0700)
Ticket: CM-3346
Reviewed By:
Testing Done: sanity test

config/addons.conf
ifupdown/ifupdownmain.py
ifupdown/scheduler.py

index 6b1137443ed8f92592e5744ae6b2ab75b403746e..91038d15312730645a5c61954a18cc3c3a80d4ba 100644 (file)
@@ -1,11 +1,11 @@
 pre-up,ifenslave
-pre-up,bridge
-pre-up,bridgevlanaware
-pre-up,mstpctl
 pre-up,vlan
 pre-up,vxlan
 pre-up,usercmds
 pre-up,loopback
+pre-up,bridgevlanaware
+pre-up,bridge
+pre-up,mstpctl
 up,dhcp
 up,address
 up,addressvirtual
@@ -18,9 +18,9 @@ down,dhcp
 down,addressvirtual
 down,address
 down,usercmds
+post-down,mstpctl
 post-down,bridgevlanaware
 post-down,bridge
-post-down,mstpctl
 post-down,vxlan
 post-down,vlan
 post-down,ifenslave
index 28b9eeb80c1ad3f3f1c27678e6689079c864328b..392b75c1414ccc13603a036a7d562b0147995dff 100644 (file)
@@ -197,6 +197,20 @@ class ifupdownMain(ifupdownBase):
     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 """
index c7531fe6437a7a0b0330d667f992fde2bfe6436f..e686f04d320dcf5dc510eaae8b0dba7227553f9e 100644 (file)
@@ -99,6 +99,7 @@ class ifaceScheduler():
         # 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)
@@ -356,7 +357,7 @@ class ifaceScheduler():
         #
         # 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:
@@ -368,7 +369,9 @@ class ifaceScheduler():
             # 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)