Skip to content

Commit 84e0190

Browse files
pyfontanPierre-yves FONTANIERE
and
Pierre-yves FONTANIERE
authored
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 <[email protected]>
1 parent bc6ae84 commit 84e0190

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minor_changes:
2+
- redfish_info - adds ``RedfishURI`` and ``StorageId`` to Disk inventory (https://github.com/ansible-collections/community.general/pull/8937).

plugins/module_utils/redfish_utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,7 @@ def get_disk_inventory(self, systems_uri):
866866
return response
867867
data = response['data']
868868
controller_name = 'Controller 1'
869+
storage_id = data['Id']
869870
if 'Controllers' in data:
870871
controllers_uri = data['Controllers'][u'@odata.id']
871872

@@ -900,6 +901,7 @@ def get_disk_inventory(self, systems_uri):
900901
data = response['data']
901902

902903
drive_result = {}
904+
drive_result['RedfishURI'] = data['@odata.id']
903905
for property in properties:
904906
if property in data:
905907
if data[property] is not None:
@@ -911,6 +913,7 @@ def get_disk_inventory(self, systems_uri):
911913
drive_result[property] = data[property]
912914
drive_results.append(drive_result)
913915
drives = {'Controller': controller_name,
916+
'StorageId': storage_id,
914917
'Drives': drive_results}
915918
result["entries"].append(drives)
916919

0 commit comments

Comments
 (0)