mirror of
https://opendev.org/x/pyghmi
synced 2025-01-14 03:37:47 +00:00
Add M.2 Drive Firmware
M.2 drive firmware is held in a different area in the API. Provide that data along non-M.2 drives. Change-Id: I94b85687b2f22bc45d6e37c9da855f7bbd426c2f
This commit is contained in:
parent
9515a4f7e0
commit
520b7dbeca
@ -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'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user