diff --git a/SOURCES/bz1437965-1-fence_compute-project_id-to-project_name.patch b/SOURCES/bz1437965-1-fence_compute-project_id-to-project_name.patch new file mode 100644 index 0000000..1cefeb8 --- /dev/null +++ b/SOURCES/bz1437965-1-fence_compute-project_id-to-project_name.patch @@ -0,0 +1,86 @@ +diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py +index 0a238b6..4b229b0 100644 +--- a/fence/agents/compute/fence_compute.py ++++ b/fence/agents/compute/fence_compute.py +@@ -4,6 +4,7 @@ import sys + import time + import atexit + import logging ++import inspect + import requests.exceptions + + sys.path.append("@FENCEAGENTSLIBDIR@") +@@ -310,15 +311,46 @@ def create_nova_connection(options): + + versions = [ "2.11", "2" ] + for version in versions: +- nova = client.Client(version, +- options["--username"], +- options["--password"], +- options["--tenant-name"], +- options["--auth-url"], +- insecure=options["--insecure"], +- region_name=options["--region-name"], +- endpoint_type=options["--endpoint-type"], +- http_log_debug=options.has_key("--verbose")) ++ clientargs = inspect.getargspec(client.Client).varargs ++ ++ # Some versions of Openstack prior to Ocata only ++ # supported positional arguments for username, ++ # password and tenant. ++ # ++ # Versions since Ocata only support named arguments. ++ # ++ # So we need to use introspection to figure out how to ++ # create a Nova client. ++ # ++ # Happy days ++ # ++ if clientargs: ++ # OSP < 11 ++ # ArgSpec(args=['version', 'username', 'password', 'project_id', 'auth_url'], ++ # varargs=None, ++ # keywords='kwargs', defaults=(None, None, None, None)) ++ nova = client.Client(version, ++ options["--username"], ++ options["--password"], ++ options["--tenant-name"], ++ options["--auth-url"], ++ insecure=options["--insecure"], ++ region_name=options["--region-name"], ++ endpoint_type=options["--endpoint-type"], ++ http_log_debug=options.has_key("--verbose")) ++ else: ++ # OSP >= 11 ++ # ArgSpec(args=['version'], varargs='args', keywords='kwargs', defaults=None) ++ nova = client.Client(version, ++ username=options["--username"], ++ password=options["--password"], ++ tenant_name=options["--tenant-name"], ++ auth_url=options["--auth-url"], ++ insecure=options["--insecure"], ++ region_name=options["--region-name"], ++ endpoint_type=options["--endpoint-type"], ++ http_log_debug=options.has_key("--verbose")) ++ + try: + nova.hypervisors.list() + return +@@ -329,7 +361,7 @@ def create_nova_connection(options): + except Exception as e: + logging.warning("Nova connection failed. %s: %s" % (e.__class__.__name__, e)) + +- fail_usage("Couldn't obtain a supported connection to nova, tried: %s" % repr(versions)) ++ logging.warning("Couldn't obtain a supported connection to nova, tried: %s\n" % repr(versions)) + + def define_new_opts(): + all_opt["endpoint-type"] = { +@@ -417,7 +449,7 @@ def main(): + global override_status + atexit.register(atexit_handler) + +- device_opt = ["login", "passwd", "tenant-name", "auth-url", "fabric_fencing", "on_target", ++ device_opt = ["login", "passwd", "tenant-name", "auth-url", "fabric_fencing", + "no_login", "no_password", "port", "domain", "no-shared-storage", "endpoint-type", + "record-only", "instance-filtering", "insecure", "region-name"] + define_new_opts() diff --git a/SOURCES/bz1437965-2-fence_compute-project_id-to-project_name.patch b/SOURCES/bz1437965-2-fence_compute-project_id-to-project_name.patch new file mode 100644 index 0000000..4a7cf09 --- /dev/null +++ b/SOURCES/bz1437965-2-fence_compute-project_id-to-project_name.patch @@ -0,0 +1,87 @@ +diff -uNr a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py +--- a/fence/agents/compute/fence_compute.py 2017-04-03 13:46:57.686399749 +0200 ++++ b/fence/agents/compute/fence_compute.py 2017-04-03 14:26:37.882659207 +0200 +@@ -314,45 +314,45 @@ + + versions = [ "2.11", "2" ] + for version in versions: +- clientargs = inspect.getargspec(client.Client).varargs ++ clientargs = inspect.getargspec(client.Client).varargs + +- # Some versions of Openstack prior to Ocata only +- # supported positional arguments for username, +- # password and tenant. +- # +- # Versions since Ocata only support named arguments. +- # +- # So we need to use introspection to figure out how to +- # create a Nova client. +- # +- # Happy days +- # +- if clientargs: +- # OSP < 11 +- # ArgSpec(args=['version', 'username', 'password', 'project_id', 'auth_url'], +- # varargs=None, +- # keywords='kwargs', defaults=(None, None, None, None)) +- nova = client.Client(version, +- options["--username"], +- options["--password"], +- options["--tenant-name"], +- options["--auth-url"], +- insecure=options["--insecure"], +- region_name=options["--region-name"], +- endpoint_type=options["--endpoint-type"], +- http_log_debug=options.has_key("--verbose")) +- else: +- # OSP >= 11 +- # ArgSpec(args=['version'], varargs='args', keywords='kwargs', defaults=None) +- nova = client.Client(version, +- username=options["--username"], +- password=options["--password"], +- tenant_name=options["--tenant-name"], +- auth_url=options["--auth-url"], +- insecure=options["--insecure"], +- region_name=options["--region-name"], +- endpoint_type=options["--endpoint-type"], +- http_log_debug=options.has_key("--verbose")) ++ # Some versions of Openstack prior to Ocata only ++ # supported positional arguments for username, ++ # password and tenant. ++ # ++ # Versions since Ocata only support named arguments. ++ # ++ # So we need to use introspection to figure out how to ++ # create a Nova client. ++ # ++ # Happy days ++ # ++ if clientargs: ++ # OSP < 11 ++ # ArgSpec(args=['version', 'username', 'password', 'project_id', 'auth_url'], ++ # varargs=None, ++ # keywords='kwargs', defaults=(None, None, None, None)) ++ nova = client.Client(version, ++ options["--username"], ++ options["--password"], ++ options["--tenant-name"], ++ options["--auth-url"], ++ insecure=options["--insecure"], ++ region_name=options["--region-name"], ++ endpoint_type=options["--endpoint-type"], ++ http_log_debug=options.has_key("--verbose")) ++ else: ++ # OSP >= 11 ++ # ArgSpec(args=['version'], varargs='args', keywords='kwargs', defaults=None) ++ nova = client.Client(version, ++ username=options["--username"], ++ password=options["--password"], ++ tenant_name=options["--tenant-name"], ++ auth_url=options["--auth-url"], ++ insecure=options["--insecure"], ++ region_name=options["--region-name"], ++ endpoint_type=options["--endpoint-type"], ++ http_log_debug=options.has_key("--verbose")) + + try: + nova.hypervisors.list() diff --git a/SPECS/fence-agents.spec b/SPECS/fence-agents.spec index c953f1f..cfda945 100644 --- a/SPECS/fence-agents.spec +++ b/SPECS/fence-agents.spec @@ -16,7 +16,7 @@ Name: fence-agents Summary: Fence Agents for Red Hat Cluster Version: 4.0.11 -Release: 47%{?alphatag:.%{alphatag}}%{?dist}.3 +Release: 47%{?alphatag:.%{alphatag}}%{?dist}.5 License: GPLv2+ and LGPLv2+ Group: System Environment/Base URL: http://sourceware.org/cluster/wiki/ @@ -121,6 +121,8 @@ Patch96: bz1287059-2-fence_rhevm-add-filter-header.patch Patch97: bz1387590-compute-fix-plug-domain-name-nova-force-down.patch Patch98: bz1397889-monitor_port_as_ip.patch Patch99: bz1412722-cisco_ucs-admin.patch +Patch100: bz1437965-1-fence_compute-project_id-to-project_name.patch +Patch101: bz1437965-2-fence_compute-project_id-to-project_name.patch %if 0%{?rhel} %global supportedagents apc apc_snmp bladecenter brocade cisco_mds cisco_ucs compute drac5 eaton_snmp emerson eps hpblade ibmblade ifmib ilo ilo_moonshot ilo_mp ilo_ssh intelmodular ipdu ipmilan mpath kdump rhevm rsa rsb scsi vmware_soap wti @@ -246,6 +248,8 @@ BuildRequires: autoconf automake libtool %patch97 -p1 -b .bz1393789 %patch98 -p1 -b .bz1397889 %patch99 -p1 -b .bz1412722 +%patch100 -p1 -b .bz1437965-1 +%patch101 -p1 -b .bz1437965-2 %build ./autogen.sh @@ -813,6 +817,10 @@ The fence-agents-zvm package contains a fence agent for z/VM hypervisors %endif %changelog +* Mon Apr 3 2017 Oyvind Albrigtsen - 4.0.11-47.5 +- fence_compute: fix project_id changed to project_name in Nova API + Resolves: rhbz#1437965 + * Mon Jan 23 2017 Marek Grac - 4.0.11-47.3 - fence_cisco_ucs: Change command sent to UCS Resolves: rhbz#1412722