From 9744e0d1b0cf17ee793532bcb96419bd368d0328 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 9 Apr 2025 12:19:16 -0400 Subject: [PATCH] Accept XCC and BMC for aliases of each other --- .../confluent/plugins/hardwaremanagement/ipmi.py | 12 +++++++++++- .../confluent/plugins/hardwaremanagement/redfish.py | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 7e5d7a18..16878d95 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -55,6 +55,15 @@ def get_dns_txt(qstring): return eventlet.support.greendns.resolver.query( qstring, 'TXT')[0].strings[0].replace('i=', '') +def match_aliases(first, second): + aliases = { + ('bmc', 'xcc') + } + for alias in aliases: + if first in alias and second in alias: + return True + return False + def get_pci_text_from_ids(subdevice, subvendor, device, vendor): fqpi = '{0}.{1}.{2}.{3}'.format(subdevice, subvendor, device, vendor) if fqpi in pci_cache: @@ -960,7 +969,8 @@ class IpmiHandler(object): complist = () if component == 'all' else (component,) for id, data in self.ipmicmd.get_firmware(complist): if (component in ('core', 'all') or - component == simplify_name(id)): + component == simplify_name(id) or + match_aliases(component, simplify_name(id))): items.append({id: data}) except ssl.SSLEOFError: errorneeded = msg.ConfluentNodeError( diff --git a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py index 7f60dd88..2a2d26f5 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py @@ -46,6 +46,15 @@ def get_dns_txt(qstring): return eventlet.support.greendns.resolver.query( qstring, 'TXT')[0].strings[0].replace('i=', '') +def match_aliases(first, second): + aliases = { + ('bmc', 'xcc') + } + for alias in aliases: + if first in alias and second in alias: + return True + return False + def get_pci_text_from_ids(subdevice, subvendor, device, vendor): fqpi = '{0}.{1}.{2}.{3}'.format(subdevice, subvendor, device, vendor) if fqpi in pci_cache: @@ -817,7 +826,8 @@ class IpmiHandler(object): complist = () if component == 'all' else (component,) for id, data in self.ipmicmd.get_firmware(complist): if (component in ('core', 'all') or - component == simplify_name(id)): + component == simplify_name(id) or + match_aliases(component, simplify_name(id))): items.append({id: data}) except ssl.SSLEOFError: errorneeded = msg.ConfluentNodeError(