From ea926aab12b321ed0a41aed8d53231b7415e20d9 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 9 Oct 2026 16:32:49 -0400 Subject: [PATCH] Improve snoop behavior For one, at the time an XCC emits a NOTIFY, it's DeviceDescription.json is also very sluggish. Extend timeout knowing this may be delayed. Further, if snoop comes back with only one address family, do not perturb existing address families. --- confluent_server/confluent/discovery/core.py | 15 ++++++++++++++- .../confluent/discovery/protocols/ssdp.py | 3 ++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index 1dcd1ce9..e01e39b4 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -881,7 +881,7 @@ async def detected(info): # have the same address, but need to be reset # in that case, however, a user can clear pubkeys to force a check return - known_info[info['info_identifier']] = info + merge_info(known_info, info['info_identifier'], info) cfg = cfm.ConfigManager(None) if handler: handler = handler.NodeHandler(info, cfg) @@ -974,6 +974,19 @@ async def detected(info): info['discostatus'] = 'unidentified' unknown_info[info['info_identifier']] = info +def merge_info(thedict, key, new_info): + oinfo = thedict.get(key) + thedict[key] = new_info + if oinfo: + oldaddresses = set(oinfo.get('addresses', [])) + newaddress = set(new_info.get('addresses', [])) + for naddr in newaddress: + for oaddr in list(oldaddresses): + if len(naddr) == len(oaddr): + oldaddresses.discard(oaddr) + merged_addresses = list(oldaddresses | newaddress) + thedict[key]['addresses'] = merged_addresses + def b64tohex(b64str): diff --git a/confluent_server/confluent/discovery/protocols/ssdp.py b/confluent_server/confluent/discovery/protocols/ssdp.py index 27a3aa1d..34eb0003 100644 --- a/confluent_server/confluent/discovery/protocols/ssdp.py +++ b/confluent_server/confluent/discovery/protocols/ssdp.py @@ -536,7 +536,8 @@ async def check_fish(urldata, port=443, verifycallback=None): url, data = urldata targtype = 'generic-redfish' try: - wc = webclient.WebConnection(_get_svrip(data), port, verifycallback=verifycallback, timeout=3) + thetimeout = 8 if url == '/DeviceDescription.json' else 3 + wc = webclient.WebConnection(_get_svrip(data), port, verifycallback=verifycallback, timeout=thetimeout) peerinfo = await wc.grab_json_response(url, headers={'Accept': 'application/json', 'Host': 'credible-bmc'}) except (socket.error, asyncio.exceptions.TimeoutError): return None