]> git.proxmox.com Git - mirror_ifupdown2.git/blobdiff - ifupdown2/addons/vrf.py
addons: vrf: fix link-down yes on vrf slaves
[mirror_ifupdown2.git] / ifupdown2 / addons / vrf.py
index 7cba995f311fe597ce7eae475c16726a185ad996..3fbec5b6a29c016930d75fd076f42d65d484d7e9 100644 (file)
@@ -495,8 +495,9 @@ class vrf(moduleBase):
                     master_exists = False
             else:
                 master_exists = False
-            if master_exists and not ifaceobj.link_privflags & ifaceLinkPrivFlags.KEEP_LINK_DOWN:
-                netlink.link_set_updown(ifacename, "up")
+            if master_exists:
+                if not ifaceobj.link_privflags & ifaceLinkPrivFlags.KEEP_LINK_DOWN:
+                    netlink.link_set_updown(ifacename, "up")
             else:
                 self.log_error('vrf %s not around, skipping vrf config'
                                %(vrfname), ifaceobj)
@@ -674,11 +675,11 @@ class vrf(moduleBase):
             for s in config_slaves:
                 try:
                     for slave_ifaceobj in ifaceobj_getfunc(s) or []:
-                        if ifaceobj.link_privflags & ifaceLinkPrivFlags.KEEP_LINK_DOWN:
-                            raise Exception('%s: slave configured with link-down yes')
+                        if slave_ifaceobj.link_privflags & ifaceLinkPrivFlags.KEEP_LINK_DOWN:
+                            raise Exception("link-down yes: keeping VRF slave down")
                     netlink.link_set_updown(s, "up")
                 except Exception, e:
-                    self.logger.debug('%s: %s' % (ifaceobj.name, str(e)))
+                    self.logger.debug("%s: %s" % (s, str(e)))
                     pass
 
     def _set_vrf_dev_processed_flag(self, ifaceobj):