diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 42e86010..7810ee24 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -604,8 +604,12 @@ class Command(object): # to store cached copies for given device id, product id, mfg id, # sdr timestamp, our data version revision, aux firmware revision, # and oem defined field + self.oem_init() if self._sdr is None: - self._sdr = sdr.SDR(self, self._sdrcachedir) + if hasattr(self._oem, 'init_sdr'): + self._sdr = self._oem.init_sdr() + else: + self._sdr = sdr.SDR(self, self._sdrcachedir) return self._sdr def get_event_constants(self): diff --git a/pyghmi/ipmi/sdr.py b/pyghmi/ipmi/sdr.py index 54d83616..c90e9b5c 100644 --- a/pyghmi/ipmi/sdr.py +++ b/pyghmi/ipmi/sdr.py @@ -836,9 +836,12 @@ class SDR(object): if self.sensors[number].readable: yield number + def make_sdr_entry(self, sdrbytes): + return SDREntry(sdrbytes, self.ipmicmd.get_event_constants(), + False, self.mfg_id, self.prod_id) + def add_sdr(self, sdrbytes): - newent = SDREntry(sdrbytes, self.ipmicmd.get_event_constants(), - False, self.mfg_id, self.prod_id) + newent = self.make_sdr_entry(sdrbytes) if newent.sdrtype == TYPE_SENSOR: id = '{0}.{1}.{2}'.format( newent.sensor_owner, newent.sensor_number, newent.sensor_lun)