2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Retry OEM lookup if no specific OEM identified

Some devices might experience a problem returning a useful response to
get device id under certain circumstance.  Make failures due to
inability to lock into a device id transient rather than persistent.

Change-Id: Ie11155632c1a627a1c3303555a6ba10926c7efb0
This commit is contained in:
Jarrod Johnson 2018-10-10 10:41:28 -04:00
parent ba1fc32e76
commit 82e015edb2
2 changed files with 7 additions and 4 deletions

View File

@ -140,6 +140,7 @@ class Command(object):
self.bmc = bmc
self._sdr = None
self._oem = None
self._oemknown = False
self._netchannel = None
self._ipv6support = None
self.certverify = None
@ -220,9 +221,10 @@ class Command(object):
method does an interrogation to identify the OEM.
"""
if self._oem:
if self._oemknown:
return
self._oem = get_oem_handler(self._get_device_id(), self)
self._oem, self._oemknown = get_oem_handler(self._get_device_id(),
self)
def get_bootdev(self):
"""Get current boot device override information.

View File

@ -26,6 +26,7 @@ oemmap = {
def get_oem_handler(oemid, ipmicmd):
try:
return oemmap[oemid['manufacturer_id']].OEMHandler(oemid, ipmicmd)
return (oemmap[oemid['manufacturer_id']].OEMHandler(oemid, ipmicmd),
True)
except KeyError:
return generic.OEMHandler(oemid, ipmicmd)
return generic.OEMHandler(oemid, ipmicmd), False