2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-15 12:17:44 +00:00

Gather Thinkserver CPU and Memory independently

If CPU inventory is unavalible, proceed to get memory inventory.
If memory inventory is unavailable, cleanly omit the data.

Change-Id: If9d5eec1aa5dcc7a2800e30636ff4cedee48a311
This commit is contained in:
Jarrod Johnson 2015-06-11 14:33:12 -04:00
parent 59d7945957
commit 7ba12de874

View File

@ -223,22 +223,29 @@ class OEMHandler(generic.OEMHandler):
def _collect_tsm_inventory(self):
# Collect CPU inventory
self.oem_inventory_info = {}
process_cpus = True
try:
rsp = self.ipmicmd.xraw_command(netfn=6, command=0x59,
data=(0, 0xc1, 1, 0))
except pygexc.IpmiException:
return
compcount = ord(rsp['data'][1])
for cpu in xrange(0, compcount):
offset = 2 + (85 * cpu)
self._decode_tsm_cpu(offset, rsp['data'])
process_cpus = False
if process_cpus:
compcount = ord(rsp['data'][1])
for cpu in xrange(0, compcount):
offset = 2 + (85 * cpu)
self._decode_tsm_cpu(offset, rsp['data'])
# Collect memory inventory
rsp = self.ipmicmd.xraw_command(netfn=6, command=0x59,
data=(0, 0xc1, 2, 0))
compcount = ord(rsp['data'][1])
for dimm in xrange(0, compcount):
offset = 2 + (dimm * 84)
self._decode_tsm_dimm(offset, rsp['data'])
process_memory = True
try:
rsp = self.ipmicmd.xraw_command(netfn=6, command=0x59,
data=(0, 0xc1, 2, 0))
except pygexc.IpmiException:
process_memory = False
if process_memory:
compcount = ord(rsp['data'][1])
for dimm in xrange(0, compcount):
offset = 2 + (dimm * 84)
self._decode_tsm_dimm(offset, rsp['data'])
def process_fru(self, fru):
if fru is None: