From 82e015edb26eee794a70f1a5c68dbdfeb2e1a103 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 10 Oct 2018 10:41:28 -0400 Subject: [PATCH] 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 --- pyghmi/ipmi/command.py | 6 ++++-- pyghmi/ipmi/oem/lookup.py | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index b1565eff..2bd140d7 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -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. diff --git a/pyghmi/ipmi/oem/lookup.py b/pyghmi/ipmi/oem/lookup.py index e123470b..71a39553 100755 --- a/pyghmi/ipmi/oem/lookup.py +++ b/pyghmi/ipmi/oem/lookup.py @@ -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