2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-29 00:31:09 +00:00

Fix errors when switch and/or switchport are not set

It was nagging about conflicts, when not actually set.  Treat ''
as being the same as not setting at all.
This commit is contained in:
Jarrod Johnson
2017-05-26 13:55:54 -04:00
parent fdb8ef6919
commit 53821d98e6
@@ -313,11 +313,15 @@ def _full_updatemacmap(configmanager):
for attr in cfg:
if not attr.endswith('.switch') or 'value' not in cfg[attr]:
continue
curswitch = cfg[attr]['value']
curswitch = cfg[attr].get('value', None)
if not curswitch:
continue
switches.add(curswitch)
switchportattr = attr + 'port'
if switchportattr in cfg:
portname = cfg[switchportattr]['value']
portname = cfg[switchportattr].get('value', '')
if not portname:
continue
if curswitch not in _switchportmap:
_switchportmap[curswitch] = {}
if portname in _switchportmap[curswitch]: