1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

mstpctlutil: fix strip on NoneType warning

saw this during execution of the below command:
ifup --no-act -a

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
Roopa Prabhu
2016-02-26 15:32:18 -08:00
parent 768b4ec52f
commit 15bb78054f

View File

@ -74,10 +74,14 @@ class mstpctlutil(utilsBase):
''' '''
self.mstpctl_bridgeport_attrs_dict = {} self.mstpctl_bridgeport_attrs_dict = {}
self.mstpctl_bridgeport_attrs_dict[bridgename] = {} self.mstpctl_bridgeport_attrs_dict[bridgename] = {}
showall_output = self.subprocess_check_output(['/sbin/mstpctl', try:
'showportdetail', bridgename, 'json']).strip('\n') showall_output = self.subprocess_check_output(['/sbin/mstpctl',
if showall_output == None or showall_output == '': 'showportdetail', bridgename, 'json'])
except:
pass
if not showall_output or showall_output == '':
return return
showall_output = showall_output.strip('\n')
mstpctl_bridge_cache = json.loads(showall_output) mstpctl_bridge_cache = json.loads(showall_output)
for portname in mstpctl_bridge_cache.keys(): for portname in mstpctl_bridge_cache.keys():
# we will ignore the portid for now and just index # we will ignore the portid for now and just index