get standard properties for each firmware entry (#51028)
This commit is contained in:
parent
d55479d063
commit
63f7536594
1 changed files with 16 additions and 13 deletions
|
@ -506,26 +506,29 @@ class RedfishUtils(object):
|
||||||
|
|
||||||
def get_firmware_inventory(self):
|
def get_firmware_inventory(self):
|
||||||
result = {}
|
result = {}
|
||||||
firmware = {}
|
|
||||||
response = self.get_request(self.root_uri + self.firmware_uri)
|
response = self.get_request(self.root_uri + self.firmware_uri)
|
||||||
if response['ret'] is False:
|
if response['ret'] is False:
|
||||||
return response
|
return response
|
||||||
result['ret'] = True
|
result['ret'] = True
|
||||||
data = response['data']
|
data = response['data']
|
||||||
|
|
||||||
|
result['entries'] = []
|
||||||
for device in data[u'Members']:
|
for device in data[u'Members']:
|
||||||
d = device[u'@odata.id']
|
uri = self.root_uri + device[u'@odata.id']
|
||||||
d = d.replace(self.firmware_uri, "") # leave just device name
|
# Get details for each device
|
||||||
if "Installed" in d:
|
response = self.get_request(uri)
|
||||||
uri = self.root_uri + self.firmware_uri + d
|
if response['ret'] is False:
|
||||||
# Get details for each device that is relevant
|
return response
|
||||||
response = self.get_request(uri)
|
result['ret'] = True
|
||||||
if response['ret'] is False:
|
data = response['data']
|
||||||
return response
|
firmware = {}
|
||||||
result['ret'] = True
|
# Get these standard properties if present
|
||||||
data = response['data']
|
for key in ['Name', 'Id', 'Status', 'Version', 'Updateable',
|
||||||
firmware[data[u'Name']] = data[u'Version']
|
'SoftwareId', 'LowestSupportedVersion', 'Manufacturer',
|
||||||
result["entries"] = firmware
|
'ReleaseDate']:
|
||||||
|
if key in data:
|
||||||
|
firmware[key] = data.get(key)
|
||||||
|
result['entries'].append(firmware)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def get_manager_attributes(self):
|
def get_manager_attributes(self):
|
||||||
|
|
Loading…
Reference in a new issue