[PR #8937/84e0190e backport][stable-9] Disk description now contains a StorageId and a RedfishURI (#8942)

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>
(cherry picked from commit 84e0190eee)

Co-authored-by: Pierre-yves Fontaniere <pyfontan@cc.in2p3.fr>
pull/8943/head
patchback[bot] 2024-09-28 08:10:49 +03:00 committed by GitHub
parent 5949b29a12
commit d97f1a31ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1,2 @@
minor_changes:
- redfish_info - adds ``RedfishURI`` and ``StorageId`` to Disk inventory (https://github.com/ansible-collections/community.general/pull/8937).

View File

@ -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)