You've already forked community.general
mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-14 16:01:01 +03:00
Fix GetChassisPower when multiple chassis are present (#4902)
* Fix GetChassisPower when multiple chassis are present When multiple chassis are present, and one or more of those chassis do _not_ report power information, the GetChassisPower command will fail. To address that, only report a failure if _all_ of the Chassis objects lack power power reporting functionality. Fixes #4901 * Update changelogs/fragments/4901-fix-redfish-chassispower.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@ -1888,14 +1888,13 @@ class RedfishUtils(object):
|
||||
for property in properties:
|
||||
if property in data:
|
||||
chassis_power_result[property] = data[property]
|
||||
else:
|
||||
return {'ret': False, 'msg': 'Key PowerControl not found.'}
|
||||
chassis_power_results.append(chassis_power_result)
|
||||
else:
|
||||
return {'ret': False, 'msg': 'Key Power not found.'}
|
||||
|
||||
result['entries'] = chassis_power_results
|
||||
return result
|
||||
if len(chassis_power_results) > 0:
|
||||
result['entries'] = chassis_power_results
|
||||
return result
|
||||
else:
|
||||
return {'ret': False, 'msg': 'Power information not found.'}
|
||||
|
||||
def get_chassis_thermals(self):
|
||||
result = {}
|
||||
|
Reference in New Issue
Block a user