From 195f370418bf0a3215f5350cbb35c69f72ec5243 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 31 Mar 2016 16:57:21 -0400 Subject: [PATCH] Remove a cyclical reference in Lenovo OEM For now, use weakref to break a cyclic reference. Longer term, probably refactor the needed 'xraw_command' to session and pass session to the handler rather than the parent command handler. Change-Id: If129ff6abf8666978aa05b6695ed7373070cd6b9 --- pyghmi/ipmi/oem/lenovo/handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index ee757172..79c0dd1c 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -41,6 +41,7 @@ import pyghmi.util.webclient as wc import socket import struct +import weakref inventory.register_inventory_category(cpu) inventory.register_inventory_category(dimm) @@ -127,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 = ipmicmd + self.ipmicmd = weakref.ref(ipmicmd) self._has_megarac = None self.oem_inventory_info = None