Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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).
16 changes: 8 additions & 8 deletions plugins/module_utils/redfish_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,19 +851,19 @@ def get_volume_inventory(self, systems_uri):
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 = []
Expand Down