mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
Add a check to see if it is indeed a bridge port before applying mstpctl
config Ticket: CM-6965 Reviewed By: CCR-3472 Testing Done: Tested with interfaces file specified in the bug
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
# Author: Roopa Prabhu, roopa@cumulusnetworks.com
|
# Author: Roopa Prabhu, roopa@cumulusnetworks.com
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import os
|
||||||
from sets import Set
|
from sets import Set
|
||||||
from ifupdown.iface import *
|
from ifupdown.iface import *
|
||||||
from ifupdownaddons.modulebase import moduleBase
|
from ifupdownaddons.modulebase import moduleBase
|
||||||
@@ -281,6 +282,9 @@ class mstpctl(moduleBase):
|
|||||||
for p in portlist:
|
for p in portlist:
|
||||||
try:
|
try:
|
||||||
(port, val) = p.split('=')
|
(port, val) = p.split('=')
|
||||||
|
# if it is not bridge port, continue
|
||||||
|
if not os.path.exists('/sys/class/net/%s/brport' %port):
|
||||||
|
continue
|
||||||
self.mstpctlcmd.set_bridgeport_attr(ifaceobj.name,
|
self.mstpctlcmd.set_bridgeport_attr(ifaceobj.name,
|
||||||
port, dstattrname, val, check)
|
port, dstattrname, val, check)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
@@ -315,6 +319,9 @@ class mstpctl(moduleBase):
|
|||||||
continue
|
continue
|
||||||
if not mstpd_running:
|
if not mstpd_running:
|
||||||
continue
|
continue
|
||||||
|
# if its not a bridge port, continue
|
||||||
|
if not os.path.exists('/sys/class/net/%s/brport' %ifaceobj.name):
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
self.mstpctlcmd.set_bridgeport_attr(bridgename,
|
self.mstpctlcmd.set_bridgeport_attr(bridgename,
|
||||||
ifaceobj.name, dstattrname, attrval, check)
|
ifaceobj.name, dstattrname, attrval, check)
|
||||||
@@ -336,6 +343,8 @@ class mstpctl(moduleBase):
|
|||||||
%(ifaceobj.name, bport))
|
%(ifaceobj.name, bport))
|
||||||
if not self.ipcmd.link_exists(bport):
|
if not self.ipcmd.link_exists(bport):
|
||||||
continue
|
continue
|
||||||
|
if not os.path.exists('/sys/class/net/%s/brport' %bport):
|
||||||
|
continue
|
||||||
bportifaceobjlist = ifaceobj_getfunc(bport)
|
bportifaceobjlist = ifaceobj_getfunc(bport)
|
||||||
if not bportifaceobjlist:
|
if not bportifaceobjlist:
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user