From 84e0190eee332ffba6e79132c2a78483f283b659 Mon Sep 17 00:00:00 2001 From: Pierre-yves Fontaniere Date: Fri, 27 Sep 2024 21:30:54 +0200 Subject: [PATCH] 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 --- .../fragments/8937-add-StorageId-RedfishURI-to-disk-facts.yml | 2 ++ plugins/module_utils/redfish_utils.py | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/8937-add-StorageId-RedfishURI-to-disk-facts.yml diff --git a/changelogs/fragments/8937-add-StorageId-RedfishURI-to-disk-facts.yml b/changelogs/fragments/8937-add-StorageId-RedfishURI-to-disk-facts.yml new file mode 100644 index 0000000000..6b66918234 --- /dev/null +++ b/changelogs/fragments/8937-add-StorageId-RedfishURI-to-disk-facts.yml @@ -0,0 +1,2 @@ +minor_changes: + - redfish_info - adds ``RedfishURI`` and ``StorageId`` to Disk inventory (https://github.com/ansible-collections/community.general/pull/8937). \ No newline at end of file diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py index c1efd00b70..102d826e6d 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -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)