VMware: Handle KeyError while moving VM from suspended to poweredon
Modified module_utils/vmware.py to handle KeyError while moving VM from suspened to poweredon state.
This commit is contained in:
parent
41e19a4058
commit
356e3e30fa
1 changed files with 1 additions and 0 deletions
|
@ -739,6 +739,7 @@ def set_vm_power_state(content, vm, state, force, timeout=0):
|
||||||
if not force and current_state not in ['poweredon', 'poweredoff']:
|
if not force and current_state not in ['poweredon', 'poweredoff']:
|
||||||
result['failed'] = True
|
result['failed'] = True
|
||||||
result['msg'] = "Virtual Machine is in %s power state. Force is required!" % current_state
|
result['msg'] = "Virtual Machine is in %s power state. Force is required!" % current_state
|
||||||
|
result['instance'] = gather_vm_facts(content, vm)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
# State is not already true
|
# State is not already true
|
||||||
|
|
Loading…
Reference in a new issue