diff --git a/0001-fence_compute-Add-insecure-command-line-argument.patch b/0001-fence_compute-Add-insecure-command-line-argument.patch deleted file mode 100644 index 353a5a6..0000000 --- a/0001-fence_compute-Add-insecure-command-line-argument.patch +++ /dev/null @@ -1,69 +0,0 @@ -From b3f74614a1ecbac509a84f291c17884866765317 Mon Sep 17 00:00:00 2001 -From: Vincent Untz -Date: Thu, 7 Jan 2016 22:07:27 +0100 -Subject: [PATCH 1/8] fence_compute: Add --insecure command line argument - -This makes it possible to have fence_compute work with OpenStack -deployments with SSL certificates that can't be verified (can be the -case in test systems). ---- - fence/agents/compute/fence_compute.py | 12 +++++++++++- - tests/data/metadata/fence_compute.xml | 5 +++++ - 2 files changed, 16 insertions(+), 1 deletion(-) - -diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py -index d9fe54a..ef066d4 100644 ---- a/fence/agents/compute/fence_compute.py -+++ b/fence/agents/compute/fence_compute.py -@@ -242,6 +242,15 @@ def define_new_opts(): - "default" : "", - "order": 1, - } -+ all_opt["insecure"] = { -+ "getopt" : "", -+ "longopt" : "insecure", -+ "help" : "--insecure Explicitly allow agent to perform \"insecure\" TLS (https) requests", -+ "required" : "0", -+ "shortdesc" : "Allow Insecure TLS Requests", -+ "default" : "False", -+ "order": 2, -+ } - all_opt["domain"] = { - "getopt" : "d:", - "longopt" : "domain", -@@ -286,7 +295,7 @@ def main(): - - device_opt = ["login", "passwd", "tenant-name", "auth-url", "fabric_fencing", "on_target", - "no_login", "no_password", "port", "domain", "no-shared-storage", "endpoint-type", -- "record-only", "instance-filtering"] -+ "record-only", "instance-filtering", "insecure"] - define_new_opts() - all_opt["shell_timeout"]["default"] = "180" - -@@ -331,6 +340,7 @@ def main(): - options["--password"], - options["--tenant-name"], - options["--auth-url"], -+ insecure=options["--insecure"], - endpoint_type=options["--endpoint-type"]) - - if options["--action"] in ["off", "reboot"]: -diff --git a/tests/data/metadata/fence_compute.xml b/tests/data/metadata/fence_compute.xml -index 290a2eb..5aeae40 100644 ---- a/tests/data/metadata/fence_compute.xml -+++ b/tests/data/metadata/fence_compute.xml -@@ -43,6 +43,11 @@ - - Keystone Admin Tenant - -+ -+ -+ -+ Allow Insecure TLS Requests -+ - - - --- -2.6.2 - diff --git a/0003-fence_compute-Create-nova-client-with-API-2.11.patch b/0001-fence_compute-Create-nova-client-with-API-2.11.patch similarity index 76% rename from 0003-fence_compute-Create-nova-client-with-API-2.11.patch rename to 0001-fence_compute-Create-nova-client-with-API-2.11.patch index a806d79..fa7efdf 100644 --- a/0003-fence_compute-Create-nova-client-with-API-2.11.patch +++ b/0001-fence_compute-Create-nova-client-with-API-2.11.patch @@ -1,7 +1,7 @@ -From 105f9a9066b3907da4cf1ecde3a484bd8c546b3f Mon Sep 17 00:00:00 2001 +From e774f32d1cd912de1f208be74faa44c3d0a1df41 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Wed, 3 Feb 2016 11:33:32 +0100 -Subject: [PATCH 3/8] fence_compute: Create nova client with API 2.11 +Subject: [PATCH 1/9] fence_compute: Create nova client with API 2.11 The force_down API requires to use version 2.11 or later. --- @@ -9,10 +9,10 @@ The force_down API requires to use version 2.11 or later. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py -index d1d797e..b443a3c 100644 +index b93580b..a4f62dc 100644 --- a/fence/agents/compute/fence_compute.py +++ b/fence/agents/compute/fence_compute.py -@@ -344,7 +344,7 @@ def main(): +@@ -348,7 +348,7 @@ def main(): sys.exit(0) # The first argument is the Nova client version @@ -22,5 +22,5 @@ index d1d797e..b443a3c 100644 options["--password"], options["--tenant-name"], -- -2.6.2 +2.8.3 diff --git a/0002-fence_compute-Add-region-name-command-line-argument.patch b/0002-fence_compute-Add-region-name-command-line-argument.patch deleted file mode 100644 index 2441389..0000000 --- a/0002-fence_compute-Add-region-name-command-line-argument.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 16d9f9108897c9335e759667ae091162c911cb08 Mon Sep 17 00:00:00 2001 -From: Vincent Untz -Date: Thu, 7 Jan 2016 22:17:51 +0100 -Subject: [PATCH 2/8] fence_compute: Add --region-name command line argument - -Useful for multi-region setups. ---- - fence/agents/compute/fence_compute.py | 12 +++++++++++- - tests/data/metadata/fence_compute.xml | 5 +++++ - 2 files changed, 16 insertions(+), 1 deletion(-) - -diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py -index ef066d4..d1d797e 100644 ---- a/fence/agents/compute/fence_compute.py -+++ b/fence/agents/compute/fence_compute.py -@@ -242,6 +242,15 @@ def define_new_opts(): - "default" : "", - "order": 1, - } -+ all_opt["region-name"] = { -+ "getopt" : "", -+ "longopt" : "region-name", -+ "help" : "--region-name=[region] Region Name", -+ "required" : "0", -+ "shortdesc" : "Region Name", -+ "default" : "", -+ "order": 1, -+ } - all_opt["insecure"] = { - "getopt" : "", - "longopt" : "insecure", -@@ -295,7 +304,7 @@ def main(): - - device_opt = ["login", "passwd", "tenant-name", "auth-url", "fabric_fencing", "on_target", - "no_login", "no_password", "port", "domain", "no-shared-storage", "endpoint-type", -- "record-only", "instance-filtering", "insecure"] -+ "record-only", "instance-filtering", "insecure", "region-name"] - define_new_opts() - all_opt["shell_timeout"]["default"] = "180" - -@@ -341,6 +350,7 @@ def main(): - options["--tenant-name"], - options["--auth-url"], - insecure=options["--insecure"], -+ region_name=options["--region-name"], - endpoint_type=options["--endpoint-type"]) - - if options["--action"] in ["off", "reboot"]: -diff --git a/tests/data/metadata/fence_compute.xml b/tests/data/metadata/fence_compute.xml -index 5aeae40..e5c112c 100644 ---- a/tests/data/metadata/fence_compute.xml -+++ b/tests/data/metadata/fence_compute.xml -@@ -38,6 +38,11 @@ - - Physical plug number on device, UUID or identification of machine - -+ -+ -+ -+ Region Name -+ - - - --- -2.6.2 - diff --git a/0002-fence_compute-Keep-compatibility-with-python-novacli.patch b/0002-fence_compute-Keep-compatibility-with-python-novacli.patch new file mode 100644 index 0000000..6b1f11e --- /dev/null +++ b/0002-fence_compute-Keep-compatibility-with-python-novacli.patch @@ -0,0 +1,46 @@ +From 29425375744cc04d85a1e25a839de47593913c87 Mon Sep 17 00:00:00 2001 +From: Vincent Untz +Date: Wed, 23 Mar 2016 11:03:24 +0100 +Subject: [PATCH 2/9] fence_compute: Keep compatibility with python-novaclient + <= 2.26.0 + +--- + fence/agents/compute/fence_compute.py | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py +index a4f62dc..265a347 100644 +--- a/fence/agents/compute/fence_compute.py ++++ b/fence/agents/compute/fence_compute.py +@@ -324,7 +324,12 @@ def main(): + run_delay(options) + + try: +- from novaclient import client as nova_client ++ from distutils.version import LooseVersion ++ except ImportError: ++ fail_usage("distutils not found or not accessible") ++ ++ try: ++ import novaclient + except ImportError: + fail_usage("nova not found or not accessible") + +@@ -347,8 +352,12 @@ def main(): + elif options["--action"] in ["monitor", "status"]: + sys.exit(0) + +- # The first argument is the Nova client version +- nova = nova_client.Client('2.11', ++ if LooseVersion(novaclient.__version__) <= LooseVersion('2.26.0') : ++ api_version = '2' ++ else: ++ api_version = '2.11' ++ ++ nova = novaclient.client.Client(api_version, + options["--username"], + options["--password"], + options["--tenant-name"], +-- +2.8.3 + diff --git a/0007-fence_compute-Only-list-nova-compute-services-when-g.patch b/0003-fence_compute-Only-list-nova-compute-services-when-g.patch similarity index 82% rename from 0007-fence_compute-Only-list-nova-compute-services-when-g.patch rename to 0003-fence_compute-Only-list-nova-compute-services-when-g.patch index 6e1ded7..97d96b7 100644 --- a/0007-fence_compute-Only-list-nova-compute-services-when-g.patch +++ b/0003-fence_compute-Only-list-nova-compute-services-when-g.patch @@ -1,7 +1,7 @@ -From 35a454b4a7b7e5890d204c1a9893b2909ddccd27 Mon Sep 17 00:00:00 2001 +From 3cdf6e12ca6af51dcc9ec4bb5bf4d521922e8339 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Thu, 4 Feb 2016 10:02:49 +0100 -Subject: [PATCH 7/8] fence_compute: Only list nova-compute services when +Subject: [PATCH 3/9] fence_compute: Only list nova-compute services when getting status We don't care about other services. @@ -10,7 +10,7 @@ We don't care about other services. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py -index 7d7aa49..0273aa2 100644 +index e3d5061..bb3798b 100644 --- a/fence/agents/compute/fence_compute.py +++ b/fence/agents/compute/fence_compute.py @@ -34,7 +34,7 @@ def get_power_status(_, options): @@ -23,5 +23,5 @@ index 7d7aa49..0273aa2 100644 logging.debug("Status of %s is %s" % (service.binary, service.state)) if service.binary == "nova-compute": -- -2.6.2 +2.8.3 diff --git a/0004-fence_compute-Don-t-list-hypervisors-but-nova-comput.patch b/0004-fence_compute-Don-t-list-hypervisors-but-nova-comput.patch new file mode 100644 index 0000000..62110de --- /dev/null +++ b/0004-fence_compute-Don-t-list-hypervisors-but-nova-comput.patch @@ -0,0 +1,84 @@ +From 5cf13d5866d0541281c914ab4edf42cd09d5462b Mon Sep 17 00:00:00 2001 +From: Vincent Untz +Date: Thu, 4 Feb 2016 09:59:43 +0100 +Subject: [PATCH 4/9] fence_compute: Don't list hypervisors but nova-compute + services + +Everything we do (evacuate, force_down) is on nova-compute services, so +there's no reason to list hypervisors; just directly look for +nova-compute services. + +This matters as hypervisors are always FQDN, while nova service hosts +can be short hostnames. +--- + fence/agents/compute/fence_compute.py | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py +index bb3798b..f32c795 100644 +--- a/fence/agents/compute/fence_compute.py ++++ b/fence/agents/compute/fence_compute.py +@@ -218,23 +218,23 @@ def fix_domain(options): + if nova: + # Find it in nova + +- hypervisors = nova.hypervisors.list() +- for hypervisor in hypervisors: +- shorthost = hypervisor.hypervisor_hostname.split('.')[0] ++ services = nova.services.list(binary="nova-compute") ++ for service in services: ++ shorthost = service.host.split('.')[0] + +- if shorthost == hypervisor.hypervisor_hostname: ++ if shorthost == service.host: + # Nova is not using FQDN + calculated = "" + else: + # Compute nodes are named as FQDN, strip off the hostname +- calculated = hypervisor.hypervisor_hostname.replace(shorthost+".", "") ++ calculated = service.host.replace(shorthost+".", "") + + domains[calculated] = shorthost + + if calculated == last_domain: + # Avoid complaining for each compute node with the same name + # One hopes they don't appear interleaved as A.com B.com A.com B.com +- logging.debug("Calculated the same domain from: %s" % hypervisor.hypervisor_hostname) ++ logging.debug("Calculated the same domain from: %s" % service.host) + + elif "--domain" in options and options["--domain"] == calculated: + # Supplied domain name is valid +@@ -243,7 +243,7 @@ def fix_domain(options): + elif "--domain" in options: + # Warn in case nova isn't available at some point + logging.warning("Supplied domain '%s' does not match the one calculated from: %s" +- % (options["--domain"], hypervisor.hypervisor_hostname)) ++ % (options["--domain"], service.host)) + + last_domain = calculated + +@@ -255,7 +255,7 @@ def fix_domain(options): + + elif len(domains) == 1: + logging.error("Overriding supplied domain '%s' does not match the one calculated from: %s" +- % (options["--domain"], hypervisor.hypervisor_hostname)) ++ % (options["--domain"], service.host)) + options["--domain"] = last_domain + + elif len(domains) > 1: +@@ -294,9 +294,9 @@ def get_plugs_list(_, options): + result = {} + + if nova: +- hypervisors = nova.hypervisors.list() +- for hypervisor in hypervisors: +- longhost = hypervisor.hypervisor_hostname ++ services = nova.services.list(binary="nova-compute") ++ for service in services: ++ longhost = service.host + shorthost = longhost.split('.')[0] + result[longhost] = ("", None) + result[shorthost] = ("", None) +-- +2.8.3 + diff --git a/0005-fence_compute-Do-not-override-domain-if-it-is-alread.patch b/0005-fence_compute-Do-not-override-domain-if-it-is-alread.patch new file mode 100644 index 0000000..336bc3a --- /dev/null +++ b/0005-fence_compute-Do-not-override-domain-if-it-is-alread.patch @@ -0,0 +1,28 @@ +From 8cb524bea4a2e84787bddbcba9e42e9377d0c94c Mon Sep 17 00:00:00 2001 +From: Vincent Untz +Date: Wed, 29 Jun 2016 09:42:56 +0200 +Subject: [PATCH 5/9] fence_compute: Do not override domain if it is already + correct + +--- + fence/agents/compute/fence_compute.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py +index f32c795..b0f3c2e 100644 +--- a/fence/agents/compute/fence_compute.py ++++ b/fence/agents/compute/fence_compute.py +@@ -253,8 +253,8 @@ def fix_domain(options): + elif len(domains) == 1 and "--domain" not in options: + options["--domain"] = last_domain + +- elif len(domains) == 1: +- logging.error("Overriding supplied domain '%s' does not match the one calculated from: %s" ++ elif len(domains) == 1 and options["--domain"] != last_domain: ++ logging.error("Overriding supplied domain '%s' as it does not match the one calculated from: %s" + % (options["--domain"], service.host)) + options["--domain"] = last_domain + +-- +2.8.3 + diff --git a/0005-fence_compute-Evacuate-instances-on-all-tenants.patch b/0005-fence_compute-Evacuate-instances-on-all-tenants.patch deleted file mode 100644 index f17d250..0000000 --- a/0005-fence_compute-Evacuate-instances-on-all-tenants.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 7f059392abfb5bb72f08747f1fd9c3456bd0c766 Mon Sep 17 00:00:00 2001 -From: Vincent Untz -Date: Wed, 3 Feb 2016 16:57:45 +0100 -Subject: [PATCH 5/8] fence_compute: Evacuate instances on all tenants - -We don't want to evacuate instances in just one tenant, so when we list -the instances, we need to look at all tenants, not just the current one. ---- - fence/agents/compute/fence_compute.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py -index feb86c0..be4d173 100644 ---- a/fence/agents/compute/fence_compute.py -+++ b/fence/agents/compute/fence_compute.py -@@ -103,7 +103,7 @@ def _get_evacuable_images(): - - def _host_evacuate(options): - result = True -- servers = nova.servers.list(search_opts={'host': options["--plug"]}) -+ servers = nova.servers.list(search_opts={'host': options["--plug"], 'all_tenants': 1}) - if options["--instance-filtering"] == "False": - evacuables = servers - else: --- -2.6.2 - diff --git a/0006-fence_compute-Fix-use-of-undefined-variable.patch b/0006-fence_compute-Fix-use-of-undefined-variable.patch new file mode 100644 index 0000000..e7d0155 --- /dev/null +++ b/0006-fence_compute-Fix-use-of-undefined-variable.patch @@ -0,0 +1,48 @@ +From 12596126400e54fdd6d94073db6eda1e3f456fdb Mon Sep 17 00:00:00 2001 +From: Vincent Untz +Date: Wed, 29 Jun 2016 09:43:57 +0200 +Subject: [PATCH 6/9] fence_compute: Fix use of undefined variable + +--- + fence/agents/compute/fence_compute.py | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py +index b0f3c2e..8665e50 100644 +--- a/fence/agents/compute/fence_compute.py ++++ b/fence/agents/compute/fence_compute.py +@@ -263,6 +263,8 @@ def fix_domain(options): + % (options["--domain"], repr(domains))) + sys.exit(1) + ++ return last_domain ++ + def fix_plug_name(options): + if options["--action"] == "list": + return +@@ -270,15 +272,16 @@ def fix_plug_name(options): + if "--plug" not in options: + return + +- fix_domain(options) ++ calculated = fix_domain(options) ++ ++ if calculated is None or "--domain" not in options: ++ # Nothing supplied and nova not available... what to do... nothing ++ return ++ + short_plug = options["--plug"].split('.')[0] + logging.debug("Checking target '%s' against calculated domain '%s'"% (options["--plug"], calculated)) + +- if "--domain" not in options: +- # Nothing supplied and nova not available... what to do... nothing +- return +- +- elif options["--domain"] == "": ++ if options["--domain"] == "": + # Ensure any domain is stripped off since nova isn't using FQDN + options["--plug"] = short_plug + +-- +2.8.3 + diff --git a/0006-fence_compute-On-list-don-t-list-hypervisors-but-nov.patch b/0006-fence_compute-On-list-don-t-list-hypervisors-but-nov.patch deleted file mode 100644 index 335bcaa..0000000 --- a/0006-fence_compute-On-list-don-t-list-hypervisors-but-nov.patch +++ /dev/null @@ -1,39 +0,0 @@ -From a1f665a1f3da3afd94d9888432579ecea7c3bfbf Mon Sep 17 00:00:00 2001 -From: Vincent Untz -Date: Thu, 4 Feb 2016 09:59:43 +0100 -Subject: [PATCH 6/8] fence_compute: On list, don't list hypervisors but - nova-compute services - -Everything we do (evacuate, force_down) is on nova-compute services, so -there's no reason to list hypervisors; just directly look for -nova-compute services. ---- - fence/agents/compute/fence_compute.py | 12 +++--------- - 1 file changed, 3 insertions(+), 9 deletions(-) - -diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py -index be4d173..7d7aa49 100644 ---- a/fence/agents/compute/fence_compute.py -+++ b/fence/agents/compute/fence_compute.py -@@ -202,15 +202,9 @@ def get_plugs_list(_, options): - result = {} - - if nova: -- hypervisors = nova.hypervisors.list() -- for hypervisor in hypervisors: -- longhost = hypervisor.hypervisor_hostname -- if options["--domain"] != "": -- shorthost = longhost.replace("." + options["--domain"], "") -- result[longhost] = ("", None) -- result[shorthost] = ("", None) -- else: -- result[longhost] = ("", None) -+ services = nova.services.list(binary="nova-compute") -+ for service in services: -+ result[service.host] = ("", None) - return result - - --- -2.6.2 - diff --git a/0007-fence_compute-Fix-fix_domain-to-not-return-too-early.patch b/0007-fence_compute-Fix-fix_domain-to-not-return-too-early.patch new file mode 100644 index 0000000..3cb7b8e --- /dev/null +++ b/0007-fence_compute-Fix-fix_domain-to-not-return-too-early.patch @@ -0,0 +1,58 @@ +From 70e2867a472530a03d9d8c3ebb6c98361a692bf9 Mon Sep 17 00:00:00 2001 +From: Vincent Untz +Date: Wed, 29 Jun 2016 09:50:12 +0200 +Subject: [PATCH 7/9] fence_compute: Fix fix_domain to not return too early + +We were returning from the loop, while we want the rest of the code to +still execute (in case there are multiple domains in nova). + +Also simplify the code... +--- + fence/agents/compute/fence_compute.py | 14 +++++--------- + 1 file changed, 5 insertions(+), 9 deletions(-) + +diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py +index 8665e50..3b0c729 100644 +--- a/fence/agents/compute/fence_compute.py ++++ b/fence/agents/compute/fence_compute.py +@@ -229,24 +229,20 @@ def fix_domain(options): + # Compute nodes are named as FQDN, strip off the hostname + calculated = service.host.replace(shorthost+".", "") + +- domains[calculated] = shorthost +- + if calculated == last_domain: + # Avoid complaining for each compute node with the same name + # One hopes they don't appear interleaved as A.com B.com A.com B.com + logging.debug("Calculated the same domain from: %s" % service.host) ++ continue + +- elif "--domain" in options and options["--domain"] == calculated: +- # Supplied domain name is valid +- return ++ domains[calculated] = service.host ++ last_domain = calculated + +- elif "--domain" in options: ++ if "--domain" in options and options["--domain"] != calculated: + # Warn in case nova isn't available at some point + logging.warning("Supplied domain '%s' does not match the one calculated from: %s" + % (options["--domain"], service.host)) + +- last_domain = calculated +- + if len(domains) == 0 and "--domain" not in options: + logging.error("Could not calculate the domain names used by compute nodes in nova") + +@@ -255,7 +251,7 @@ def fix_domain(options): + + elif len(domains) == 1 and options["--domain"] != last_domain: + logging.error("Overriding supplied domain '%s' as it does not match the one calculated from: %s" +- % (options["--domain"], service.host)) ++ % (options["--domain"], domains[last_domain])) + options["--domain"] = last_domain + + elif len(domains) > 1: +-- +2.8.3 + diff --git a/0008-fence_compute-Deprecate-the-domain-option.patch b/0008-fence_compute-Deprecate-the-domain-option.patch deleted file mode 100644 index ec42664..0000000 --- a/0008-fence_compute-Deprecate-the-domain-option.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 79d653464fa85cf09c98014f82b5874de250944b Mon Sep 17 00:00:00 2001 -From: Vincent Untz -Date: Thu, 4 Feb 2016 10:08:20 +0100 -Subject: [PATCH 8/8] fence_compute: Deprecate the domain option - -As far as I understand, this should not be needed anymore: the domain -option was really only useful to translate between hypervisor hostname -and nova service hostname, and we don't get hypervisor hostnames -anywhere anymore. - -The option is left around to not break existing configurations that are -using it. ---- - fence/agents/compute/fence_compute.py | 8 ++------ - tests/data/metadata/fence_compute.xml | 2 +- - 2 files changed, 3 insertions(+), 7 deletions(-) - -diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py -index 0273aa2..eccab99 100644 ---- a/fence/agents/compute/fence_compute.py -+++ b/fence/agents/compute/fence_compute.py -@@ -257,9 +257,9 @@ def define_new_opts(): - all_opt["domain"] = { - "getopt" : "d:", - "longopt" : "domain", -- "help" : "-d, --domain=[string] DNS domain in which hosts live, useful when the cluster uses short names and nova uses FQDN", -+ "help" : "-d, --domain=[string] Deprecated option; do not do anything anymore", - "required" : "0", -- "shortdesc" : "DNS domain in which hosts live", -+ "shortdesc" : "Deprecated option", - "default" : "", - "order": 5, - } -@@ -318,10 +318,6 @@ def main(): - except ImportError: - fail_usage("nova not found or not accessible") - -- # Potentially we should make this a pacemaker feature -- if options["--action"] != "list" and options["--domain"] != "" and options.has_key("--plug"): -- options["--plug"] = options["--plug"] + "." + options["--domain"] -- - if options["--record-only"] in [ "2", "Disabled", "disabled" ]: - sys.exit(0) - -diff --git a/tests/data/metadata/fence_compute.xml b/tests/data/metadata/fence_compute.xml -index e5c112c..82e0fde 100644 ---- a/tests/data/metadata/fence_compute.xml -+++ b/tests/data/metadata/fence_compute.xml -@@ -56,7 +56,7 @@ - - - -- DNS domain in which hosts live -+ Deprecated option - - - --- -2.6.2 - diff --git a/0008-fence_compute-Fix-fix_plug_name-when-looking-if-plug.patch b/0008-fence_compute-Fix-fix_plug_name-when-looking-if-plug.patch new file mode 100644 index 0000000..ce0cb23 --- /dev/null +++ b/0008-fence_compute-Fix-fix_plug_name-when-looking-if-plug.patch @@ -0,0 +1,30 @@ +From 281bb6e1e842f298ff16f1e3cf5994c15d3ad1f3 Mon Sep 17 00:00:00 2001 +From: Vincent Untz +Date: Wed, 29 Jun 2016 09:51:37 +0200 +Subject: [PATCH 8/9] fence_compute: Fix fix_plug_name when looking if plug has + domain + +We shouldn't check if the plug name contains the domain, but if it ends +with the domain. +--- + fence/agents/compute/fence_compute.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py +index 3b0c729..b083660 100644 +--- a/fence/agents/compute/fence_compute.py ++++ b/fence/agents/compute/fence_compute.py +@@ -281,8 +281,8 @@ def fix_plug_name(options): + # Ensure any domain is stripped off since nova isn't using FQDN + options["--plug"] = short_plug + +- elif options["--plug"].find(options["--domain"]): +- # Plug already contains the domain, don't re-add ++ elif options["--plug"].endswith(options["--domain"]): ++ # Plug already uses the domain, don't re-add + return + + else: +-- +2.8.3 + diff --git a/0004-fence_compute-Fix-disabling-force_down-on-node-when-.patch b/0009-fence_compute-Fix-disabling-force_down-on-node-when-.patch similarity index 86% rename from 0004-fence_compute-Fix-disabling-force_down-on-node-when-.patch rename to 0009-fence_compute-Fix-disabling-force_down-on-node-when-.patch index b139b34..49a34c9 100644 --- a/0004-fence_compute-Fix-disabling-force_down-on-node-when-.patch +++ b/0009-fence_compute-Fix-disabling-force_down-on-node-when-.patch @@ -1,7 +1,7 @@ -From 6cbbe5d9e81ddeee91d06660f27a4a51117aa0ed Mon Sep 17 00:00:00 2001 +From 832011f2287f1a9f59da727312e38fb9622dc809 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Wed, 3 Feb 2016 13:45:52 +0100 -Subject: [PATCH 4/8] fence_compute: Fix disabling force_down on node when +Subject: [PATCH 9/9] fence_compute: Fix disabling force_down on node when action is on When the action is on, the goal is to disable force_down for the @@ -15,10 +15,10 @@ force_down, and then, if it's up, do more things. 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py -index b443a3c..feb86c0 100644 +index e3d5061..98ad177 100644 --- a/fence/agents/compute/fence_compute.py +++ b/fence/agents/compute/fence_compute.py -@@ -148,23 +148,23 @@ def set_power_status(_, options): +@@ -160,23 +160,23 @@ def set_power_status(_, options): return if options["--action"] == "on": @@ -27,7 +27,7 @@ index b443a3c..feb86c0 100644 + nova.services.force_down( + options["--plug"], "nova-compute", force_down=False) + except Exception as e: -+ # In theory, if foce_down=False fails, that's for the exact ++ # In theory, if force_down=False fails, that's for the exact + # same possible reasons that below with force_down=True + # eg. either an incompatible version or an old client. + # Since it's about forcing back to a default value, there is @@ -44,7 +44,7 @@ index b443a3c..feb86c0 100644 - nova.services.force_down( - options["--plug"], "nova-compute", force_down=False) - except Exception as e: -- # In theory, if foce_down=False fails, that's for the exact +- # In theory, if force_down=False fails, that's for the exact - # same possible reasons that below with force_down=True - # eg. either an incompatible version or an old client. - # Since it's about forcing back to a default value, there is @@ -57,5 +57,5 @@ index b443a3c..feb86c0 100644 # Pretend we're 'on' so that the fencing library doesn't loop forever waiting for the node to boot override_status = "on" -- -2.6.2 +2.8.3 diff --git a/fence-agents-4.0.22+git.1455008135.15c5e92.tar.xz b/fence-agents-4.0.22+git.1455008135.15c5e92.tar.xz deleted file mode 100644 index 7a80766..0000000 --- a/fence-agents-4.0.22+git.1455008135.15c5e92.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e577e1ed15dac5bb1e50375c06170269b334b2bfff57b74ee87bc7f679dfbb3c -size 201540 diff --git a/fence-agents-4.0.23.tar.gz b/fence-agents-4.0.23.tar.gz new file mode 100644 index 0000000..1a34e47 --- /dev/null +++ b/fence-agents-4.0.23.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d1ae9960ffdc328c394630632d7b452379e3e5b0dddf59aac97a1e291c9f29d +size 299185 diff --git a/fence-agents.changes b/fence-agents.changes index b4c99c8..fbaf061 100644 --- a/fence-agents.changes +++ b/fence-agents.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Thu Jun 30 09:46:45 UTC 2016 - kgronlund@suse.com + +- Update to version 4.0.23: + * A lot of changes in fence_compute (OpenStack compute instance) + * Obtain status of nodes from Cisco UCS correctly + * New fence agent for AMT using openwsman + * Python3 support + * Fence agent for PVE can be used by non-root users + * Parallel building and testing of fence agents + * Fix occasional failures of APC fence agent + +- Updated fence_compute patch set: + - Add 0001-fence_compute-Create-nova-client-with-API-2.11.patch + - Add 0002-fence_compute-Keep-compatibility-with-python-novacli.patch + - Add 0003-fence_compute-Only-list-nova-compute-services-when-g.patch + - Add 0004-fence_compute-Don-t-list-hypervisors-but-nova-comput.patch + - Add 0005-fence_compute-Do-not-override-domain-if-it-is-alread.patch + - Add 0006-fence_compute-Fix-use-of-undefined-variable.patch + - Add 0007-fence_compute-Fix-fix_domain-to-not-return-too-early.patch + - Add 0008-fence_compute-Fix-fix_plug_name-when-looking-if-plug.patch + - Add 0009-fence_compute-Fix-disabling-force_down-on-node-when-.patch + - Remove 0001-fence_compute-Add-insecure-command-line-argument.patch + - Remove 0002-fence_compute-Add-region-name-command-line-argument.patch + - Remove 0003-fence_compute-Create-nova-client-with-API-2.11.patch + - Remove 0004-fence_compute-Fix-disabling-force_down-on-node-when-.patch + - Remove 0005-fence_compute-Evacuate-instances-on-all-tenants.patch + - Remove 0006-fence_compute-On-list-don-t-list-hypervisors-but-nov.patch + - Remove 0007-fence_compute-Only-list-nova-compute-services-when-g.patch + - Remove 0008-fence_compute-Deprecate-the-domain-option.patch + ------------------------------------------------------------------- Mon Feb 22 09:18:30 UTC 2016 - kgronlund@suse.com diff --git a/fence-agents.spec b/fence-agents.spec index 4a2c9e4..db77937 100644 --- a/fence-agents.spec +++ b/fence-agents.spec @@ -22,26 +22,28 @@ Name: fence-agents Summary: Fence Agents for Pacemaker from RHCS License: GPL-2.0 and LGPL-2.1 Group: Productivity/Clustering/HA -Version: 4.0.22+git.1455008135.15c5e92 +Version: 4.0.23 Release: 0 Url: https://github.com/ClusterLabs/fence-agents -Source0: %{name}-%{version}.tar.xz -# PATCH-FIX-UPSTREAM: fence_compute: Add --insecure command line argument -Patch1: 0001-fence_compute-Add-insecure-command-line-argument.patch -# PATCH-FIX-UPSTREAM: fence_compute: Add --region-name command line argument -Patch2: 0002-fence_compute-Add-region-name-command-line-argument.patch +Source0: %{name}-%{version}.tar.gz # PATCH-FIX-UPSTREAM: fence_compute: Create nova client with API 2.11 -Patch3: 0003-fence_compute-Create-nova-client-with-API-2.11.patch -# PATCH-FIX-UPSTREAM: fence_compute: Fix disabling force_down on node when action is on -Patch4: 0004-fence_compute-Fix-disabling-force_down-on-node-when-.patch -# PATCH-FIX-UPSTREAM: fence_compute: Evacuate instances on all tenants -Patch5: 0005-fence_compute-Evacuate-instances-on-all-tenants.patch -# PATCH-FIX-UPSTREAM: fence_compute: On list, don't list hypervisors but nova-compute services -Patch6: 0006-fence_compute-On-list-don-t-list-hypervisors-but-nov.patch +Patch1: 0001-fence_compute-Create-nova-client-with-API-2.11.patch +# PATCH-FIX-UPSTREAM: fence_compute: Keep compatibility with python-novaclient <= 2.26.0 +Patch2: 0002-fence_compute-Keep-compatibility-with-python-novacli.patch # PATCH-FIX-UPSTREAM: fence_compute: Only list nova-compute services when getting status -Patch7: 0007-fence_compute-Only-list-nova-compute-services-when-g.patch -# PATCH-FIX-UPSTREAM: fence_compute: Deprecate the domain option -Patch8: 0008-fence_compute-Deprecate-the-domain-option.patch +Patch3: 0003-fence_compute-Only-list-nova-compute-services-when-g.patch +# PATCH-FIX-UPSTREAM: fence_compute: On list, don't list hypervisors but nova-compute services +Patch4: 0004-fence_compute-Don-t-list-hypervisors-but-nova-comput.patch +# PATCH-FIX-UPSTREAM: fence_compute: Do not override domain if it is already correct +Patch5: 0005-fence_compute-Do-not-override-domain-if-it-is-alread.patch +# PATCH-FIX-UPSTREAM: fence_compute: Fix use of undefined variable +Patch6: 0006-fence_compute-Fix-use-of-undefined-variable.patch +# PATCH-FIX-UPSTREAM: fence_compute: Fix fix_domain to not return too early +Patch7: 0007-fence_compute-Fix-fix_domain-to-not-return-too-early.patch +# PATCH-FIX-UPSTREAM: fence_compute: Fix fix_plug_name when looking if plug has domain +Patch8: 0008-fence_compute-Fix-fix_plug_name-when-looking-if-plug.patch +# PATCH-FIX-UPSTREAM: fence_compute: Fix disabling force_down on node when action is on +Patch9: 0009-fence_compute-Fix-disabling-force_down-on-node-when-.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf @@ -53,6 +55,7 @@ BuildRequires: libxml2-tools BuildRequires: libxslt BuildRequires: mozilla-nspr-devel BuildRequires: mozilla-nss-devel +BuildRequires: openwsman-python BuildRequires: perl BuildRequires: perl-Net-Telnet BuildRequires: pkg-config @@ -66,6 +69,7 @@ BuildRequires: xz Requires: net-snmp Requires: openssh +Requires: openwsman-python Requires: perl-Net-Telnet Requires: python-curl Requires: python-openssl @@ -110,6 +114,7 @@ fence agents only suitable for development. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 %build CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}"