redfish_utils: fix reference to local variable 'systems_service' (#50298)
* fixes issue 50296
* fixes the indentation of the return statement
* Adds a conditional test into `_find_systems_resource()` to check the existence
of the Members of System resource
* updates the error message
* harden the conditional test
* Add a changelog
(cherry picked from commit 94a1d86d70
)
This commit is contained in:
parent
40cec0e4f4
commit
361f34b4fe
2 changed files with 11 additions and 4 deletions
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
bugfixes:
|
||||
- redfish_utils - fix reference to local variable 'systems_service'
|
|
@ -128,10 +128,14 @@ class RedfishUtils(object):
|
|||
if response['ret'] is False:
|
||||
return response
|
||||
data = response['data']
|
||||
for member in data[u'Members']:
|
||||
systems_service = member[u'@odata.id']
|
||||
self.systems_uri = systems_service
|
||||
return {'ret': True}
|
||||
if data.get(u'Members'):
|
||||
for member in data[u'Members']:
|
||||
systems_service = member[u'@odata.id']
|
||||
self.systems_uri = systems_service
|
||||
return {'ret': True}
|
||||
else:
|
||||
return {'ret': False,
|
||||
'msg': "ComputerSystem's Members array is either empty or missing"}
|
||||
|
||||
def _find_updateservice_resource(self, uri):
|
||||
response = self.get_request(self.root_uri + uri)
|
||||
|
|
Loading…
Reference in a new issue