mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add support for Redfish PowerCycle reset type (#7113)
* Add support for Redfish PowerCycle reset type * Add changelog frament
This commit is contained in:
parent
55cfd27be9
commit
6a558734f7
3 changed files with 9 additions and 2 deletions
2
changelogs/fragments/7113-redfish-utils-power-cycle.yml
Normal file
2
changelogs/fragments/7113-redfish-utils-power-cycle.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- redfish_utils module utils - add support for ``PowerCycle`` reset type for ``redfish_command`` responses feature (https://github.com/ansible-collections/community.general/issues/7083).
|
|
@ -1074,7 +1074,12 @@ class RedfishUtils(object):
|
|||
# command should be PowerOn, PowerForceOff, etc.
|
||||
if not command.startswith('Power'):
|
||||
return {'ret': False, 'msg': 'Invalid Command (%s)' % command}
|
||||
reset_type = command[5:]
|
||||
|
||||
# Commands (except PowerCycle) will be stripped of the 'Power' prefix
|
||||
if command == 'PowerCycle':
|
||||
reset_type = command
|
||||
else:
|
||||
reset_type = command[5:]
|
||||
|
||||
# map Reboot to a ResetType that does a reboot
|
||||
if reset_type == 'Reboot':
|
||||
|
|
|
@ -747,7 +747,7 @@ from ansible.module_utils.common.text.converters import to_native
|
|||
# More will be added as module features are expanded
|
||||
CATEGORY_COMMANDS_ALL = {
|
||||
"Systems": ["PowerOn", "PowerForceOff", "PowerForceRestart", "PowerGracefulRestart",
|
||||
"PowerGracefulShutdown", "PowerReboot", "SetOneTimeBoot", "EnableContinuousBootOverride", "DisableBootOverride",
|
||||
"PowerGracefulShutdown", "PowerReboot", "PowerCycle", "SetOneTimeBoot", "EnableContinuousBootOverride", "DisableBootOverride",
|
||||
"IndicatorLedOn", "IndicatorLedOff", "IndicatorLedBlink", "VirtualMediaInsert", "VirtualMediaEject", "VerifyBiosAttributes"],
|
||||
"Chassis": ["IndicatorLedOn", "IndicatorLedOff", "IndicatorLedBlink"],
|
||||
"Accounts": ["AddUser", "EnableUser", "DeleteUser", "DisableUser",
|
||||
|
|
Loading…
Reference in a new issue