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)
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):