Blame SOURCES/bz1732773-fence_vmware_rest-fix-keyerror-suspended-vms.patch

21d5fd
From 33a638ff624839d7fa2d409479c348abee57763e Mon Sep 17 00:00:00 2001
21d5fd
From: dwannamaker-onr <dwannamaker@onr.com>
21d5fd
Date: Tue, 25 Jun 2019 15:28:00 -0400
21d5fd
Subject: [PATCH] Fixed issue with SUSPENDED VMs
21d5fd
21d5fd
If any VMs in the vCenter are suspended, you get a KeyError because that state is not expected.  This breaks list and monitor actions.
21d5fd
---
21d5fd
 agents/vmware_rest/fence_vmware_rest.py | 2 +-
21d5fd
 1 file changed, 1 insertion(+), 1 deletion(-)
21d5fd
21d5fd
diff --git a/agents/vmware_rest/fence_vmware_rest.py b/agents/vmware_rest/fence_vmware_rest.py
21d5fd
index b544d385..53b4066d 100644
21d5fd
--- a/agents/vmware_rest/fence_vmware_rest.py
21d5fd
+++ b/agents/vmware_rest/fence_vmware_rest.py
21d5fd
@@ -8,7 +8,7 @@
21d5fd
 from fencing import *
21d5fd
 from fencing import fail, run_delay, EC_LOGIN_DENIED, EC_STATUS
21d5fd
 
21d5fd
-state = {"POWERED_ON": "on", 'POWERED_OFF': "off"}
21d5fd
+state = {"POWERED_ON": "on", 'POWERED_OFF': "off", 'SUSPENDED': "off"}
21d5fd
 
21d5fd
 def get_power_status(conn, options):
21d5fd
 	res = send_command(conn, "vcenter/vm?filter.names={}".format(options["--plug"]))["value"]