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:
parent
e0324cdc90
commit
c70edfa84b
2 changed files with 10 additions and 8 deletions
|
@ -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).
|
|
@ -916,19 +916,19 @@ class RedfishUtils(object):
|
||||||
response = self.get_request(self.root_uri + data['Controllers'][u'@odata.id'])
|
response = self.get_request(self.root_uri + data['Controllers'][u'@odata.id'])
|
||||||
if response['ret'] is False:
|
if response['ret'] is False:
|
||||||
return response
|
return response
|
||||||
data = response['data']
|
c_data = response['data']
|
||||||
|
|
||||||
if data.get('Members') and data['Members']:
|
if c_data.get('Members') and c_data['Members']:
|
||||||
response = self.get_request(self.root_uri + data['Members'][0][u'@odata.id'])
|
response = self.get_request(self.root_uri + c_data['Members'][0][u'@odata.id'])
|
||||||
if response['ret'] is False:
|
if response['ret'] is False:
|
||||||
return response
|
return response
|
||||||
data = response['data']
|
member_data = response['data']
|
||||||
|
|
||||||
if data:
|
if member_data:
|
||||||
if 'Name' in data:
|
if 'Name' in member_data:
|
||||||
controller_name = data['Name']
|
controller_name = member_data['Name']
|
||||||
else:
|
else:
|
||||||
controller_id = data.get('Id', '1')
|
controller_id = member_data.get('Id', '1')
|
||||||
controller_name = 'Controller %s' % controller_id
|
controller_name = 'Controller %s' % controller_id
|
||||||
volume_results = []
|
volume_results = []
|
||||||
volume_list = []
|
volume_list = []
|
||||||
|
|
Loading…
Reference in a new issue