diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 79c0dd1c..4c73ba03 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -128,7 +128,7 @@ class OEMHandler(generic.OEMHandler): # will need to retain data to differentiate # variations. For example System X versus Thinkserver self.oemid = oemid - self.ipmicmd = weakref.ref(ipmicmd) + self.ipmicmd = weakref.proxy(ipmicmd) self._has_megarac = None self.oem_inventory_info = None diff --git a/pyghmi/ipmi/sdr.py b/pyghmi/ipmi/sdr.py index a61bc8f4..e011d88b 100644 --- a/pyghmi/ipmi/sdr.py +++ b/pyghmi/ipmi/sdr.py @@ -252,7 +252,7 @@ class SDREntry(object): # ignore record id for now, we only care about the sensor number for # moment self.reportunsupported = reportunsupported - self.ipmicmd = weakref.ref(ipmicmd) + self.ipmicmd = ipmicmd if entrybytes[2] != 0x51: # only recognize '1.5', the only version defined at time of writing raise NotImplementedError @@ -585,7 +585,7 @@ class SDR(object): :param ipmicmd: A Command class object """ def __init__(self, ipmicmd): - self.ipmicmd = weakref.ref(ipmicmd) + self.ipmicmd = weakref.proxy(ipmicmd) self.sensors = {} self.fru = {} self.read_info()