mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
addons: bridge: fix check_valid_bridge for DRYRUN mode
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
@@ -827,7 +827,7 @@ class bridge(moduleBase):
|
||||
return False
|
||||
|
||||
def check_valid_bridge(self, ifaceobj, ifname):
|
||||
if LinkUtils.link_exists(ifname) and not LinkUtils.is_bridge(ifname):
|
||||
if LinkUtils.link_exists_nodryrun(ifname) and not LinkUtils.is_bridge(ifname):
|
||||
self.log_error('misconfiguration of bridge attribute(s) on existing non-bridge interface (%s)' % ifname, ifaceobj=ifaceobj)
|
||||
return False
|
||||
return True
|
||||
|
@@ -1345,6 +1345,10 @@ class LinkUtils(utilsBase):
|
||||
return True
|
||||
return os.path.exists('/sys/class/net/%s' % ifacename)
|
||||
|
||||
@staticmethod
|
||||
def link_exists_nodryrun(ifname):
|
||||
return os.path.exists('/sys/class/net/%s' % ifname)
|
||||
|
||||
def link_get_ifindex(self, ifacename):
|
||||
if ifupdownflags.flags.DRYRUN:
|
||||
return True
|
||||
|
Reference in New Issue
Block a user