2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-28 16:20:54 +00:00

Fix support for ports with hyphens in the name

This commit is contained in:
Jarrod Johnson
2017-05-11 16:48:54 -04:00
parent 298b9bcfff
commit 0e7072a256
@@ -345,12 +345,14 @@ def handle_api_request(configmanager, inputdata, operation, pathcomponents):
if switchname not in _macsbyswitch:
raise exc.NotFoundException(
'No known macs for switch {0}'.format(switchname))
return [msg.ChildCollection(x + '/')
return [msg.ChildCollection(x.replace('/', '-') + '/')
for x in sorted(list(_macsbyswitch[switchname]))]
if len(pathcomponents) == 6:
switchname = pathcomponents[-3]
portname = pathcomponents[-1]
try:
if portname not in _macsbyswitch[switchname]:
portname = portname.replace('-', '/')
maclist = _macsbyswitch[switchname][portname]
except KeyError:
raise exc.NotFoundException('No known macs for switch {0} '