From 1a0fbd424e3e02e5c81da1d5a7fc78d6fb710c14 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Sun, 12 Nov 2017 03:09:28 +0000 Subject: [PATCH] Remove hypen from vmware powerstate (#32295) This fix removes hypen while comparing to current virtual machine's powerstate. Signed-off-by: Abhijeet Kasurde --- lib/ansible/module_utils/vmware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/vmware.py b/lib/ansible/module_utils/vmware.py index baa5b065062..deaf1559a8f 100644 --- a/lib/ansible/module_utils/vmware.py +++ b/lib/ansible/module_utils/vmware.py @@ -669,7 +669,7 @@ def set_vm_power_state(content, vm, state, force): requested states. force is forceful """ facts = gather_vm_facts(content, vm) - expected_state = state.replace('_', '').lower() + expected_state = state.replace('_', '').replace('-', '').lower() current_state = facts['hw_power_status'].lower() result = dict( changed=False,