Disk description now contains a StorageId and a RedfishURI (#8937)
* Disks controller is now uniquely identified by the controller ID * Fix typo `StorageID` to `StorageId` * Add changelog fragments --------- Co-authored-by: Pierre-yves FONTANIERE <pyf@cc.in2p3.fr>pull/8944/head
parent
bc6ae849b3
commit
84e0190eee
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- redfish_info - adds ``RedfishURI`` and ``StorageId`` to Disk inventory (https://github.com/ansible-collections/community.general/pull/8937).
|
|
@ -866,6 +866,7 @@ class RedfishUtils(object):
|
|||
return response
|
||||
data = response['data']
|
||||
controller_name = 'Controller 1'
|
||||
storage_id = data['Id']
|
||||
if 'Controllers' in data:
|
||||
controllers_uri = data['Controllers'][u'@odata.id']
|
||||
|
||||
|
@ -900,6 +901,7 @@ class RedfishUtils(object):
|
|||
data = response['data']
|
||||
|
||||
drive_result = {}
|
||||
drive_result['RedfishURI'] = data['@odata.id']
|
||||
for property in properties:
|
||||
if property in data:
|
||||
if data[property] is not None:
|
||||
|
@ -911,6 +913,7 @@ class RedfishUtils(object):
|
|||
drive_result[property] = data[property]
|
||||
drive_results.append(drive_result)
|
||||
drives = {'Controller': controller_name,
|
||||
'StorageId': storage_id,
|
||||
'Drives': drive_results}
|
||||
result["entries"].append(drives)
|
||||
|
||||
|
|
Loading…
Reference in New Issue