2
0
mirror of https://opendev.org/x/pyghmi synced 2026-08-28 09:36:43 +00:00

Use weak reference to return a proxy of object for gc

https://gitlab.icelab.lenovo.com/pygcon/pyghmi/commit/a64eb41ecdb72270d5db26a5ef6c850ee79cab10 (75175)[legacy_Servers]Electrolux - M4/M5 Nodes appear offline
use weak reference to return a proxy of object for garbage collection

Change-Id: I89ea4f06c5b163e576491e74a5c62b66eb6fcc7a
This commit is contained in:
luyf5
2021-08-31 17:45:41 +08:00
parent 30ab021853
commit 0ef75a0e21
+2 -1
View File
@@ -33,6 +33,7 @@ Information Storage Definition (Document Revision 1.2)
import struct
import time
import weakref
import pyghmi.exceptions as iexc
import pyghmi.ipmi.private.spd as spd
@@ -128,7 +129,7 @@ class FRU(object):
if self.rawfru is not None:
self.parsedata()
elif ipmicmd is not None:
self.ipmicmd = ipmicmd
self.ipmicmd = weakref.proxy(ipmicmd)
# Use the ipmicmd to fetch the data
try:
self.fetch_fru(fruid)