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

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>
This commit is contained in:
TSKushal 2023-07-15 19:58:27 +05:30 committed by GitHub
parent e0324cdc90
commit c70edfa84b
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

@ -916,19 +916,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 = []