1
0
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:
Julien Fortin
2018-07-05 17:24:16 +02:00
parent 4b0b3fa3a0
commit 9b653c8542
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -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