Blame SOURCES/bz1854310-fence_vmware_rest-2-support-utf-8-vm-names.patch

fd4025
--- a/agents/vmware_rest/fence_vmware_rest.py	2020-07-03 15:09:59.307198567 +0200
fd4025
+++ b/agents/vmware_rest/fence_vmware_rest.py	2020-07-03 15:09:52.331210984 +0200
fd4025
@@ -8,10 +8,13 @@
fd4025
 from fencing import *
fd4025
 from fencing import fail, run_delay, EC_LOGIN_DENIED, EC_STATUS
fd4025
 
fd4025
+if sys.version_info[0] > 2: import urllib.parse as urllib
fd4025
+else: import urllib
fd4025
+
fd4025
 state = {"POWERED_ON": "on", 'POWERED_OFF': "off"}
fd4025
 
fd4025
 def get_power_status(conn, options):
fd4025
-	res = send_command(conn, "vcenter/vm?filter.names={}".format(options["--plug"]))["value"]
fd4025
+	res = send_command(conn, "vcenter/vm?filter.names={}".format(urllib.quote(options["--plug"])))["value"]
fd4025
 
fd4025
 	if len(res) == 0:
fd4025
 		fail(EC_STATUS)
fd4025
@@ -36,7 +39,7 @@
fd4025
 	res = send_command(conn, "vcenter/vm")
fd4025
 
fd4025
 	for r in res["value"]:
fd4025
-		outlets[r["name"]] = ("", state[r["power_state"]])
fd4025
+		outlets[r["name"].encode("UTF-8")] = ("", state[r["power_state"]])
fd4025
 
fd4025
 	return outlets
fd4025