From 48fd49663776b779de29dde61470d2e74f809b9b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 27 Apr 2022 15:09:40 -0400 Subject: [PATCH] Fix discovery uuid cross-reference The SSDP does an endian scramble of the smm uuid, fix it, and also update the core to prefer the processed enclosure.uuid attribute. --- confluent_server/confluent/discovery/core.py | 4 +++- confluent_server/confluent/discovery/handlers/xcc.py | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index 7ca752a4..11f9b28b 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -947,7 +947,9 @@ def get_node_by_uuid_or_mac(uuidormac): def get_nodename_from_enclosures(cfg, info): nodename = None - cuuid = info.get('attributes', {}).get('chassis-uuid', [None])[0] + cuuid = info.get('enclosure.uuid', None) + if not cuuid: + cuuid = info.get('attributes', {}).get('chassis-uuid', [None])[0] if cuuid and cuuid in nodes_by_uuid: encl = nodes_by_uuid[cuuid] bay = info.get('enclosure.bay', None) diff --git a/confluent_server/confluent/discovery/handlers/xcc.py b/confluent_server/confluent/discovery/handlers/xcc.py index 537cf285..a4723e31 100644 --- a/confluent_server/confluent/discovery/handlers/xcc.py +++ b/confluent_server/confluent/discovery/handlers/xcc.py @@ -30,6 +30,15 @@ import struct getaddrinfo = eventlet.support.greendns.getaddrinfo +def fixuuid(baduuid): + # SMM dumps it out in hex + uuidprefix = (baduuid[:8], baduuid[9:13], baduuid[14:18]) + a = codecs.encode(struct.pack('