2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-07-30 09:39:39 +00:00

Fix discovery mac deletion to also clean associated node records

This commit is contained in:
Jarrod Johnson
2025-08-07 15:15:14 -04:00
parent d43de05b09
commit 960a890530
+7 -1
View File
@@ -316,6 +316,8 @@ def list_matching_nodes(criteria):
retnodes = []
for node in known_nodes:
for mac in known_nodes[node]:
if mac not in known_info:
continue
info = known_info[mac]
if _info_matches(info, criteria):
retnodes.append(node)
@@ -613,7 +615,11 @@ def handle_api_request(configmanager, inputdata, operation, pathcomponents):
return [msg.AssignedResource(inputdata['node'])]
elif operation == 'delete':
mac = _get_mac_from_query(pathcomponents)
del known_info[mac]
for node in known_nodes:
if mac in known_nodes[node]:
del known_nodes[node][mac]
if mac in known_info:
del known_info[mac]
return [msg.DeletedResource(mac)]
raise exc.NotImplementedException(
'Unable to {0} to {1}'.format(operation, '/'.join(pathcomponents)))