fence-agents/0004-fence_compute-Fix-handling-of-domain-None.patch
Kristoffer Gronlund 0876d5cd99 - Update to version 4.0.24+git.1480563949.e67fcd4:
* fence_azure_arm: add fencing agent for Azure Resource Manager
  * fence_lpar: Add support for IVM
  * fence_lpar: Handle exceptions when invalid output is read
  * fence_zvmip: Update XML metadata
  * fence_compute: fix ConnectionError by using full module name
  * fence_powerman: add fence agent for powerman
  * Suppress InsecureRequestWarning when ssl_insecure is given
  * compute: Correctly handle installations without tagged flavours
  * compute: Use the best available nova API version
  * compute: correctly implement 'on' when the force-down API call is available
  * compute: Correctly identify when the nodename already includes the supplied domain
  * compute: Ensure we can connect to nova when fixing the plug name
  * compute: Simpler check for nova force down compatibility
- Rebase and remove merged patches:
  * Remove 0001-fence_compute-Create-nova-client-with-API-2.11.patch
  * Remove 0002-fence_compute-Keep-compatibility-with-python-novacli.patch
  * Remove 0003-fence_compute-Only-list-nova-compute-services-when-g.patch
  * Remove 0004-fence_compute-Don-t-list-hypervisors-but-nova-comput.patch
  * Remove 0005-fence_compute-Do-not-override-domain-if-it-is-alread.patch
  * Remove 0006-fence_compute-Fix-use-of-undefined-variable.patch
  * Remove 0007-fence_compute-Fix-fix_domain-to-not-return-too-early.patch
  * Remove 0008-fence_compute-Fix-fix_plug_name-when-looking-if-plug.patch
  * Add 0001-fence_compute-Only-list-nova-compute-services-when-g.patch
  * Add 0002-fence_compute-Don-t-list-hypervisors-but-nova-comput.patch
  * Add 0003-fence_compute-Do-not-override-domain-if-it-is-alread.patch
  * Add 0004-fence_compute-Fix-handling-of-domain-None.patch
  * Add 0005-fence_compute-Fix-fix_domain-to-not-return-too-early.patch
  * Add 0006-fence_compute-Fix-fix_plug_name-when-looking-if-plug.patch
  * Add 0007-fence_compute-Remove-duplicate-check-for-binary-name.patch

OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/fence-agents?expand=0&rev=56
2016-12-01 13:22:57 +00:00

59 lines
2.0 KiB
Diff

From 952c40fb84b182c3600f781ed6fe6373012424ef Mon Sep 17 00:00:00 2001
From: Vincent Untz <vuntz@suse.com>
Date: Wed, 29 Jun 2016 09:43:57 +0200
Subject: [PATCH 4/9] fence_compute: Fix handling of domain == None
---
fence/agents/compute/fence_compute.py | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
index 470fd07..3c19f02 100644
--- a/fence/agents/compute/fence_compute.py
+++ b/fence/agents/compute/fence_compute.py
@@ -252,20 +252,18 @@ def fix_domain(options):
elif len(domains) == 1 and "--domain" not in options:
options["--domain"] = last_domain
- return options["--domain"]
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
- return options["--domain"]
elif len(domains) > 1:
logging.error("The supplied domain '%s' did not match any used inside nova: %s"
% (options["--domain"], repr(domains)))
sys.exit(1)
- return None
+ return last_domain
def fix_plug_name(options):
if options["--action"] == "list":
@@ -275,14 +273,15 @@ def fix_plug_name(options):
return
calculated = fix_domain(options)
- short_plug = options["--plug"].split('.')[0]
- logging.debug("Checking target '%s' against calculated domain '%s'"% (options["--plug"], options["--domain"]))
- if "--domain" not in options:
+ if calculated is None or "--domain" not in options:
# Nothing supplied and nova not available... what to do... nothing
return
- elif options["--domain"] == "":
+ short_plug = options["--plug"].split('.')[0]
+ logging.debug("Checking target '%s' against calculated domain '%s'"% (options["--plug"], calculated))
+
+ if options["--domain"] == "":
# Ensure any domain is stripped off since nova isn't using FQDN
options["--plug"] = short_plug
--
2.10.1