Skip to content

Commit

Permalink
Disk description now contains a StorageId and a RedfishURI (#8937)
Browse files Browse the repository at this point in the history
* Disks controller is now uniquely identified by the controller ID

* Fix typo `StorageID` to `StorageId`

* Add changelog fragments

---------

Co-authored-by: Pierre-yves FONTANIERE <[email protected]>
  • Loading branch information
pyfontan and Pierre-yves FONTANIERE authored Sep 27, 2024
1 parent bc6ae84 commit 84e0190
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- redfish_info - adds ``RedfishURI`` and ``StorageId`` to Disk inventory (https://github.com/ansible-collections/community.general/pull/8937).
3 changes: 3 additions & 0 deletions plugins/module_utils/redfish_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ def get_disk_inventory(self, systems_uri):
return response
data = response['data']
controller_name = 'Controller 1'
storage_id = data['Id']
if 'Controllers' in data:
controllers_uri = data['Controllers'][u'@odata.id']

Expand Down Expand Up @@ -900,6 +901,7 @@ def get_disk_inventory(self, systems_uri):
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:
Expand All @@ -911,6 +913,7 @@ def get_disk_inventory(self, systems_uri):
drive_result[property] = data[property]
drive_results.append(drive_result)
drives = {'Controller': controller_name,
'StorageId': storage_id,
'Drives': drive_results}
result["entries"].append(drives)

Expand Down

0 comments on commit 84e0190

Please sign in to comment.