2
0
mirror of https://opendev.org/x/pyghmi synced 2026-05-06 09:04:17 +00:00

Use weak reference to return a proxy of object for gc

a64eb41ecd (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

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)