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:
@@ -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} '
|
||||
|
||||
Reference in New Issue
Block a user