]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
Move stale slave delete to after the adds are done
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Fri, 15 May 2015 06:00:57 +0000 (23:00 -0700)
committerSam Tannous <stannous@cumulusnetworks.com>
Wed, 3 Jun 2015 17:17:56 +0000 (13:17 -0400)
Testing Done: Tested with sample config in the bug
(cherry picked from commit e90149a1e8ea3bc94e07fb080361e6909b12e81b)

ifupdown2/addons/ifenslave.py

index 671d7258f57183cb6b4f590dd37c53c77c08c879..c79cbb1d299db381b5521dc34c73ac931bec0fab 100644 (file)
@@ -219,10 +219,6 @@ class ifenslave(moduleBase):
 
         if not self.PERFMODE:
             runningslaves = self.ifenslavecmd.get_slaves(ifaceobj.name);
-            if runningslaves:
-                # Delete active slaves not in the new slave list
-                [ self.ifenslavecmd.remove_slave(ifaceobj.name, s)
-                    for s in runningslaves if s not in slaves ]
 
         for slave in Set(slaves).difference(Set(runningslaves)):
             if not self.PERFMODE and not self.ipcmd.link_exists(slave):
@@ -242,6 +238,11 @@ class ifenslave(moduleBase):
                                       %(ifaceobj.name, slave, str(e)))
                     pass
 
+        if runningslaves:
+            # Delete active slaves not in the new slave list
+            [ self.ifenslavecmd.remove_slave(ifaceobj.name, s)
+                    for s in runningslaves if s not in slaves ]
+
     def _set_clag_enable(self, ifaceobj):
         attrval = ifaceobj.get_attr_value_first('clag-id')
         attrval = attrval if attrval else '0'