diff --git a/fence-agents.spec b/fence-agents.spec index 9f22860..685bbfa 100644 --- a/fence-agents.spec +++ b/fence-agents.spec @@ -9,12 +9,13 @@ Name: fence-agents Summary: Set of unified programs capable of host isolation ("fencing") Version: 4.2.1 -Release: 4%{?alphatag:.%{alphatag}}%{?dist} +Release: 5%{?alphatag:.%{alphatag}}%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Base URL: https://github.com/ClusterLabs/fence-agents Source0: https://fedorahosted.org/releases/f/e/fence-agents/%{name}-%{version}.tar.xz Patch0: fence_vmware_soap-fix-python-3-suds-issue.patch +Patch1: python3-has_key-fixes.patch %if 0%{?fedora} || 0%{?rhel} > 7 # skipped: pve, raritan, rcd-serial, virsh @@ -976,6 +977,9 @@ Fence agent for IBM z/VM over IP. %{_mandir}/man8/fence_zvmip.8* %changelog +* Wed Aug 22 2018 Oyvind Albrigtsen - 4.2.1-5 +- Python 3: fix has_key() issues + * Mon Aug 20 2018 Jan Pokorný - 4.2.1-4 - mark non-compiled packages properly as noarch, restructure excludes - move azure_fence.py and XenAPI.py to respective subpackages from -common diff --git a/python3-has_key-fixes.patch b/python3-has_key-fixes.patch new file mode 100644 index 0000000..9252cb1 --- /dev/null +++ b/python3-has_key-fixes.patch @@ -0,0 +1,74 @@ +From 29f93ed6f7f79cad801bf08ad9172c8a62183435 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Tue, 14 Aug 2018 12:33:41 +0200 +Subject: [PATCH] fence_compute/fence_evacuate/fence_rhevm: dont use has_key + (not supported in Python 3) + +--- + agents/compute/fence_compute.py | 4 ++-- + agents/evacuate/fence_evacuate.py | 4 ++-- + agents/rhevm/fence_rhevm.py | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/agents/compute/fence_compute.py b/agents/compute/fence_compute.py +index ec2d093c..254e2670 100644 +--- a/agents/compute/fence_compute.py ++++ b/agents/compute/fence_compute.py +@@ -311,7 +311,7 @@ def create_nova_connection(options): + region_name=options["--region-name"], + endpoint_type=options["--endpoint-type"], + session=keystone_session, auth=keystone_auth, +- http_log_debug=options.has_key("--verbose")) ++ http_log_debug="--verbose" in options) + else: + # OSP >= 11 + # ArgSpec(args=['version'], varargs='args', keywords='kwargs', defaults=None) +@@ -319,7 +319,7 @@ def create_nova_connection(options): + region_name=options["--region-name"], + endpoint_type=options["--endpoint-type"], + session=keystone_session, auth=keystone_auth, +- http_log_debug=options.has_key("--verbose")) ++ http_log_debug="--verbose" in options) + + try: + nova.hypervisors.list() +diff --git a/agents/evacuate/fence_evacuate.py b/agents/evacuate/fence_evacuate.py +index 615dede7..6818c44f 100644 +--- a/agents/evacuate/fence_evacuate.py ++++ b/agents/evacuate/fence_evacuate.py +@@ -245,7 +245,7 @@ def create_nova_connection(options): + region_name=options["--region-name"], + endpoint_type=options["--endpoint-type"], + session=keystone_session, auth=keystone_auth, +- http_log_debug=options.has_key("--verbose")) ++ http_log_debug="--verbose" in options) + else: + # OSP >= 11 + # ArgSpec(args=['version'], varargs='args', keywords='kwargs', defaults=None) +@@ -253,7 +253,7 @@ def create_nova_connection(options): + region_name=options["--region-name"], + endpoint_type=options["--endpoint-type"], + session=keystone_session, auth=keystone_auth, +- http_log_debug=options.has_key("--verbose")) ++ http_log_debug="--verbose" in options) + + try: + nova.hypervisors.list() +diff --git a/agents/rhevm/fence_rhevm.py b/agents/rhevm/fence_rhevm.py +index 0594e66b..c06b7c39 100644 +--- a/agents/rhevm/fence_rhevm.py ++++ b/agents/rhevm/fence_rhevm.py +@@ -74,11 +74,11 @@ def send_command(opt, command, method="GET"): + url = "https:" + else: + url = "http:" +- if opt.has_key("--api-path"): ++ if "--api-path" in opt: + api_path = opt["--api-path"] + else: + api_path = "/ovirt-engine/api" +- if opt.has_key("--disable-http-filter"): ++ if "--disable-http-filter" in opt: + http_filter = 'false' + else: + http_filter = 'true'