2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-23 01:53:28 +00:00

Improve duplicate switch attribute errors

This commit is contained in:
Jarrod Johnson 2020-10-02 13:36:45 -04:00
parent 587197e934
commit 1113c2a849

View File

@ -375,12 +375,19 @@ def _full_updatemacmap(configmanager):
continue
if curswitch not in _switchportmap:
_switchportmap[curswitch] = {}
if portname in _switchportmap[curswitch]:
log.log({'error': 'Duplicate switch topology config '
'for {0} and {1}'.format(
node,
if (portname in _switchportmap[curswitch] and
_switchportmap[curswitch][portname] != node):
if _switchportmap[curswitch][portname] is None:
errstr = ('Duplicate switch attributes for {0} and '
'a previously logged duplicate'.format(
node))
else:
errstr = ('Duplicate switch topology config '
'for {0} and {1}'.format(
node,
_switchportmap[curswitch][
portname])})
portname]))
log.log({'error': errstr})
_switchportmap[curswitch][portname] = None
else:
_switchportmap[curswitch][portname] = node