mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Add GetChassisPower command to Chassis category of redfish_facts (#54314)
* Add GetChassisPower as viable Chassis command in redfish_facts * Add conditional to catch command == 'GetChassisPower' * Implement get_chassis_power() retrieving Watts-related and other useful power data from each Chassis * Add RelatedItem property and remove MemberId property * Check for length of data['PowerControl'] to be > 0 before checking index 0 of the list. * Fix return statement being inside loop and result key not being 'entries' as is expected * Update lib/ansible/module_utils/redfish_utils.py Co-Authored-By: xmadsen <xander.madsen@gmail.com> * Update lib/ansible/module_utils/redfish_utils.py Co-Authored-By: xmadsen <xander.madsen@gmail.com> * Update redfish_facts.py
This commit is contained in:
parent
9f830b77fc
commit
eb7190264e
2 changed files with 41 additions and 1 deletions
|
@ -170,7 +170,7 @@ CATEGORY_COMMANDS_ALL = {
|
|||
"GetMemoryInventory", "GetNicInventory",
|
||||
"GetStorageControllerInventory", "GetDiskInventory",
|
||||
"GetBiosAttributes", "GetBootOrder"],
|
||||
"Chassis": ["GetFanInventory", "GetPsuInventory", "GetChassisThermals"],
|
||||
"Chassis": ["GetFanInventory", "GetPsuInventory", "GetChassisPower", "GetChassisThermals"],
|
||||
"Accounts": ["ListUsers"],
|
||||
"Update": ["GetFirmwareInventory", "GetFirmwareUpdateCapabilities"],
|
||||
"Manager": ["GetManagerNicInventory", "GetLogs"],
|
||||
|
@ -281,6 +281,8 @@ def main():
|
|||
result["psu"] = rf_utils.get_psu_inventory()
|
||||
elif command == "GetChassisThermals":
|
||||
result["thermals"] = rf_utils.get_chassis_thermals()
|
||||
elif command == "GetChassisPower":
|
||||
result["chassis_power"] = rf_utils.get_chassis_power()
|
||||
|
||||
elif category == "Accounts":
|
||||
# execute only if we find an Account service resource
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue