1
0
Fork 0
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:
Jim Gu 2017-11-16 03:44:27 -05:00 committed by Abhijeet Kasurde
parent aef50eaa40
commit f6b188e521

View file

@ -724,6 +724,10 @@ def set_vm_power_state(content, vm, state, force):
result['failed'] = True result['failed'] = True
result['msg'] = "Virtual machine %s must be in poweredon state for guest shutdown/reboot" % vm.name 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: except Exception as e:
result['failed'] = True result['failed'] = True
result['msg'] = to_text(e) result['msg'] = to_text(e)