mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fail module if unknown state passed to set_vm_power_state (#32631)
This commit is contained in:
parent
aef50eaa40
commit
f6b188e521
1 changed files with 4 additions and 0 deletions
|
@ -724,6 +724,10 @@ def set_vm_power_state(content, vm, state, force):
|
|||
result['failed'] = True
|
||||
result['msg'] = "Virtual machine %s must be in poweredon state for guest shutdown/reboot" % vm.name
|
||||
|
||||
else:
|
||||
result['failed'] = True
|
||||
result['msg'] = "Unsupported expected state provided: %s" % expected_state
|
||||
|
||||
except Exception as e:
|
||||
result['failed'] = True
|
||||
result['msg'] = to_text(e)
|
||||
|
|
Loading…
Reference in a new issue