diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 23d62684..fd366fb5 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -853,19 +853,24 @@ class XCCClient(IMMClient): yield self.get_disk_firmware(diskent) elif mode==1: yield self.get_disk_hardware(diskent) + for diskent in adp.get('aimDisks', ()): + if mode==0: + yield self.get_disk_firmware(diskent, 'M.2-') + elif mode==1: + yield self.get_disk_hardware(diskent, 'M.2-') - def get_disk_hardware(self, diskent): + def get_disk_hardware(self, diskent, prefix=''): bdata = {} - diskname = 'Disk {0}'.format(diskent['slotNo']) + diskname = 'Disk {1}{0}'.format(diskent['slotNo'], prefix) bdata['Model'] = diskent['productName'].rstrip() bdata['Serial Number'] = diskent['serialNo'].rstrip() bdata['FRU Number'] = diskent['fruPartNo'].rstrip() bdata['Description'] = diskent['type'].rstrip() return (diskname, bdata) - def get_disk_firmware(self, diskent): + def get_disk_firmware(self, diskent, prefix=''): bdata = {} - diskname = 'Disk {0}'.format(diskent['slotNo']) + diskname = 'Disk {1}{0}'.format(diskent['slotNo'], prefix) bdata['model'] = diskent[ 'productName'].rstrip() bdata['version'] = diskent['fwVersion'] @@ -1190,7 +1195,7 @@ class XCCClient(IMMClient): psudata, util._monotonic_time()) if not psudata: return - for psu in psudata['items']: + for psu in psudata.get('items', ()): yield ('PSU {0}'.format(psu['slot']), { 'model': psu['model'],