fence-agents/0007-fence_compute-Fix-fix_domain-to-not-return-too-early.patch

59 lines
2.2 KiB
Diff
Raw Normal View History

From 160e505367c30d1f8ba045fc1b3ab47bf09176ad Mon Sep 17 00:00:00 2001
- 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 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/fence-agents?expand=0&rev=52
2016-06-30 12:01:27 +02:00
From: Vincent Untz <vuntz@suse.com>
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 37f48ee..1cb7df4 100644
- 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 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/fence-agents?expand=0&rev=52
2016-06-30 12:01:27 +02:00
--- 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")
@@ -256,7 +252,7 @@ def fix_domain(options):
- 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 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/fence-agents?expand=0&rev=52
2016-06-30 12:01:27 +02:00
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
return options["--domain"]
- 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 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/fence-agents?expand=0&rev=52
2016-06-30 12:01:27 +02:00
--
2.9.0
- 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 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/fence-agents?expand=0&rev=52
2016-06-30 12:01:27 +02:00