1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[PR #6883/c70edfa8 backport][stable-6] Fix for get_volume_inventory (#6947)

Fix for get_volume_inventory (#6883)

* Fix for get_volume_inventory

* Adding changelog fragment

* Update changelogs/fragments/6883-redfish-utils-changing-variable-names-in-get-volume-inventory.yml

---------

Co-authored-by: Kushal <t-s.kushal@hpe.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit c70edfa84b)

Co-authored-by: TSKushal <44438079+TSKushal@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2023-07-15 17:55:37 +02:00 committed by GitHub
parent 3c6c9ba425
commit 08036e7f65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- refish_utils module utils - changing variable names to avoid issues occuring when fetching Volumes data (https://github.com/ansible-collections/community.general/pull/6883).

View file

@ -851,19 +851,19 @@ class RedfishUtils(object):
response = self.get_request(self.root_uri + data['Controllers'][u'@odata.id'])
if response['ret'] is False:
return response
data = response['data']
c_data = response['data']
if data.get('Members') and data['Members']:
response = self.get_request(self.root_uri + data['Members'][0][u'@odata.id'])
if c_data.get('Members') and c_data['Members']:
response = self.get_request(self.root_uri + c_data['Members'][0][u'@odata.id'])
if response['ret'] is False:
return response
data = response['data']
member_data = response['data']
if data:
if 'Name' in data:
controller_name = data['Name']
if member_data:
if 'Name' in member_data:
controller_name = member_data['Name']
else:
controller_id = data.get('Id', '1')
controller_id = member_data.get('Id', '1')
controller_name = 'Controller %s' % controller_id
volume_results = []
volume_list = []