mirror of
https://github.com/xcat2/confluent.git
synced 2026-04-12 20:01:30 +00:00
Accept XCC and BMC for aliases of each other
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user