From fd402575217d4d45c6dac219c56e33bba6c7a166 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 06 2020 14:25:31 +0000 Subject: import fence-agents-4.2.1-30.el7_8.2 --- diff --git a/SOURCES/bz1854310-fence_vmware_rest-1-fix-encoding.patch b/SOURCES/bz1854310-fence_vmware_rest-1-fix-encoding.patch new file mode 100644 index 0000000..c215ab1 --- /dev/null +++ b/SOURCES/bz1854310-fence_vmware_rest-1-fix-encoding.patch @@ -0,0 +1,23 @@ +From 06cba4aa30322f410b0b2fec5785be39d0953433 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Wed, 12 Feb 2020 14:21:54 +0100 +Subject: [PATCH] fence_vmware_rest: fix encoding to avoid issues with UTF-8 + encoded comments + +--- + agents/vmware_rest/fence_vmware_rest.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/agents/vmware_rest/fence_vmware_rest.py b/agents/vmware_rest/fence_vmware_rest.py +index cd99b4ac..d07bc10d 100644 +--- a/agents/vmware_rest/fence_vmware_rest.py ++++ b/agents/vmware_rest/fence_vmware_rest.py +@@ -127,7 +127,7 @@ def send_command(conn, command, method="GET"): + raise Exception(e[1]) + + rc = conn.getinfo(pycurl.HTTP_CODE) +- result = web_buffer.getvalue().decode() ++ result = web_buffer.getvalue().decode("UTF-8") + + web_buffer.close() + diff --git a/SOURCES/bz1854310-fence_vmware_rest-2-support-utf-8-vm-names.patch b/SOURCES/bz1854310-fence_vmware_rest-2-support-utf-8-vm-names.patch new file mode 100644 index 0000000..18f1569 --- /dev/null +++ b/SOURCES/bz1854310-fence_vmware_rest-2-support-utf-8-vm-names.patch @@ -0,0 +1,26 @@ +--- a/agents/vmware_rest/fence_vmware_rest.py 2020-07-03 15:09:59.307198567 +0200 ++++ b/agents/vmware_rest/fence_vmware_rest.py 2020-07-03 15:09:52.331210984 +0200 +@@ -8,10 +8,13 @@ + from fencing import * + from fencing import fail, run_delay, EC_LOGIN_DENIED, EC_STATUS + ++if sys.version_info[0] > 2: import urllib.parse as urllib ++else: import urllib ++ + state = {"POWERED_ON": "on", 'POWERED_OFF': "off"} + + def get_power_status(conn, options): +- res = send_command(conn, "vcenter/vm?filter.names={}".format(options["--plug"]))["value"] ++ res = send_command(conn, "vcenter/vm?filter.names={}".format(urllib.quote(options["--plug"])))["value"] + + if len(res) == 0: + fail(EC_STATUS) +@@ -36,7 +39,7 @@ + res = send_command(conn, "vcenter/vm") + + for r in res["value"]: +- outlets[r["name"]] = ("", state[r["power_state"]]) ++ outlets[r["name"].encode("UTF-8")] = ("", state[r["power_state"]]) + + return outlets + diff --git a/SPECS/fence-agents.spec b/SPECS/fence-agents.spec index 134e3a2..a35e205 100644 --- a/SPECS/fence-agents.spec +++ b/SPECS/fence-agents.spec @@ -66,7 +66,7 @@ Name: fence-agents Summary: Fence Agents for Red Hat Cluster Version: 4.2.1 -Release: 30%{?alphatag:.%{alphatag}}%{?dist}.1 +Release: 30%{?alphatag:.%{alphatag}}%{?dist}.2 License: GPLv2+ and LGPLv2+ Group: System Environment/Base URL: https://github.com/ClusterLabs/fence-agents @@ -124,6 +124,8 @@ Patch38: bz1722004-1-fencing-inetX_only-SSH-fence_zvmip.patch Patch39: bz1722004-2-fence_redfish-fence_vmware_soap-suppress-warning.patch Patch40: bz1834193-1-fence_aws-improve-parameter-logic.patch Patch41: bz1834193-2-fence_aws-fix-race-condition.patch +Patch42: bz1854310-fence_vmware_rest-1-fix-encoding.patch +Patch43: bz1854310-fence_vmware_rest-2-support-utf-8-vm-names.patch # bundle patches Patch1000: bz1568753-4-fence_gce-bundled-libs.patch Patch1001: bz1568753-5-%{oauth2client}-docs-build-fix.patch @@ -215,6 +217,8 @@ BuildRequires: python-six >= 1.6.1 %patch39 -p1 %patch40 -p1 %patch41 -p1 +%patch42 -p1 +%patch43 -p1 %ifarch x86_64 # bundles @@ -1176,6 +1180,10 @@ The fence-agents-zvm package contains a fence agent for z/VM hypervisors %endif %changelog +* Tue Jul 7 2020 Oyvind Albrigtsen - 4.2.1-30.2 +- fence_vmware_rest: fix encoding issues + Resolves: rhbz#1854310 + * Tue May 12 2020 Oyvind Albrigtsen - 4.2.1-30.1 - fence_aws: fix possible race condition Resolves: rhbz#1834193