mirror of
https://github.com/xcat2/confluent.git
synced 2024-12-23 19:52:10 +00:00
Fix traceback when multiple criteria have no matches
When a parent criteria has no match, then the api returns a 404 as there is no parent. Handle this by only listing positively matched items.
This commit is contained in:
parent
4c6f41ffb2
commit
481a70c304
@ -263,7 +263,11 @@ def list_matching_macs(options, session, node=None, checknode=True):
|
||||
return [options.mac.replace(':', '-')]
|
||||
else:
|
||||
path += 'by-mac/'
|
||||
return [x['item']['href'] for x in session.read(path)]
|
||||
ret = []
|
||||
for x in session.read(path):
|
||||
if 'item' in x and 'href' in x['item']:
|
||||
ret.append(x['item', 'href'])
|
||||
return ret
|
||||
|
||||
def assign_discovery(options, session, needid=True):
|
||||
abort = False
|
||||
|
Loading…
Reference in New Issue
Block a user