2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-03-25 03:39:17 +00:00

Fix nodediscover clear

Nested async iteration of multiple confluent calls fail, break
it into two distinct queries.
This commit is contained in:
Jarrod Johnson
2024-08-09 10:03:15 -04:00
parent 8b70213c0d
commit 0d8173cbcb
2 changed files with 2 additions and 3 deletions

View File

@@ -270,7 +270,8 @@ async def list_discovery(options, session):
print(row)
async def clear_discovery(options, session):
async for mac in list_matching_macs(options, session):
allmacs = [x async for x in list_matching_macs(options, session)]
for mac in allmacs:
async for res in session.delete('/discovery/by-mac/{0}'.format(mac)):
if 'deleted' in res:
print('Cleared info for {0}'.format(res['deleted']))

View File

@@ -1615,9 +1615,7 @@ async def rescan():
if scanner:
return
else:
print("begin")
scanner = util.spawn(blocking_scan())
print("bg")
await remotescan()
async def remotescan():