Blame SOURCES/bz1549699-2-fence_compute-fence_evacuate-fix-compute-domain.patch

6a3e49
From 15635df9d12ce693f473d5ebcd5b7cacb81e2295 Mon Sep 17 00:00:00 2001
6a3e49
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
6a3e49
Date: Mon, 16 Jul 2018 11:14:16 +0200
6a3e49
Subject: [PATCH] fence_compute/fence_evacuate: workaround for compute-domain
6a3e49
 regression
6a3e49
6a3e49
---
6a3e49
 agents/compute/fence_compute.py        | 24 +++++++++++++++++++-----
6a3e49
 agents/evacuate/fence_evacuate.py      | 24 +++++++++++++++++++-----
6a3e49
 tests/data/metadata/fence_compute.xml  | 24 ++++++++++++++++++++++--
6a3e49
 tests/data/metadata/fence_evacuate.xml | 24 ++++++++++++++++++++++--
6a3e49
 4 files changed, 82 insertions(+), 14 deletions(-)
6a3e49
6a3e49
diff --git a/agents/compute/fence_compute.py b/agents/compute/fence_compute.py
6a3e49
index ec2d093c..aac9b296 100644
6a3e49
--- a/agents/compute/fence_compute.py
6a3e49
+++ b/agents/compute/fence_compute.py
6a3e49
@@ -353,7 +353,7 @@ def define_new_opts():
145e87
 		"default" : "",
145e87
 		"order": 1,
145e87
 	}
145e87
-	all_opt["user_domain"] = {
145e87
+	all_opt["user-domain"] = {
145e87
 		"getopt" : "u:",
145e87
 		"longopt" : "user-domain",
145e87
 		"help" : "-u, --user-domain=[name]       Keystone v3 User Domain",
6a3e49
@@ -362,7 +362,7 @@ def define_new_opts():
145e87
 		"default" : "Default",
145e87
 		"order": 2,
145e87
 	}
145e87
-	all_opt["project_domain"] = {
145e87
+	all_opt["project-domain"] = {
145e87
 		"getopt" : "P:",
145e87
 		"longopt" : "project-domain",
145e87
 		"help" : "-d, --project-domain=[name]    Keystone v3 Project Domain",
6a3e49
@@ -433,6 +433,14 @@ def define_new_opts():
145e87
 		"default" : "False",
145e87
 		"order": 5,
145e87
 	}
145e87
+	all_opt["compute-domain"] = {
145e87
+		"getopt" : ":",
145e87
+		"longopt" : "compute-domain",
145e87
+		"help" : "--compute-domain=[string]      Replaced by --domain",
145e87
+		"required" : "0",
145e87
+		"shortdesc" : "Replaced by domain",
145e87
+		"order": 6,
145e87
+	}
145e87
 
145e87
 def set_multi_power_fn(connection, options, set_power_fn, get_power_fn, retry_attempts=1):
145e87
 	for _ in range(retry_attempts):
6a3e49
@@ -450,9 +458,10 @@ def main():
145e87
 	global override_status
145e87
 	atexit.register(atexit_handler)
145e87
 
145e87
-	device_opt = ["login", "passwd", "tenant_name", "auth_url", "fabric_fencing",
145e87
-		      "no_login", "no_password", "port", "domain", "project_domain", "user_domain",
145e87
-		      "no_shared_storage", "endpoint_type", "record_only", "instance_filtering", "insecure", "region_name"]
145e87
+	device_opt = ["login", "passwd", "tenant_name", "auth_url", "fabric_fencing", "no_login",
145e87
+			"no_password", "port", "domain", "compute-domain", "project-domain",
145e87
+			"user-domain", "no_shared_storage", "endpoint_type", "record_only",
145e87
+			"instance_filtering", "insecure", "region_name"]
145e87
 	define_new_opts()
145e87
 	all_opt["shell_timeout"]["default"] = "180"
145e87
 
6a3e49
@@ -470,6 +479,11 @@ def main():
145e87
 
145e87
 	run_delay(options)
145e87
 
145e87
+	# workaround to avoid regressions
145e87
+	if "--compute-domain" in options and options["--compute-domain"]:
145e87
+		options["--domain"] = options["--compute-domain"]
145e87
+		del options["--domain"]
145e87
+
145e87
 	logging.debug("Running "+options["--action"])
145e87
 	connection = create_nova_connection(options)
145e87
 
6a3e49
diff --git a/agents/evacuate/fence_evacuate.py b/agents/evacuate/fence_evacuate.py
6a3e49
index 615dede7..529a60dd 100644
6a3e49
--- a/agents/evacuate/fence_evacuate.py
6a3e49
+++ b/agents/evacuate/fence_evacuate.py
6a3e49
@@ -287,7 +287,7 @@ def define_new_opts():
145e87
 		"default" : "",
145e87
 		"order": 1,
145e87
 	}
145e87
-	all_opt["user_domain"] = {
145e87
+	all_opt["user-domain"] = {
145e87
 		"getopt" : "u:",
145e87
 		"longopt" : "user-domain",
145e87
 		"help" : "-u, --user-domain=[name]       Keystone v3 User Domain",
6a3e49
@@ -296,7 +296,7 @@ def define_new_opts():
145e87
 		"default" : "Default",
145e87
 		"order": 2,
145e87
 	}
145e87
-	all_opt["project_domain"] = {
145e87
+	all_opt["project-domain"] = {
145e87
 		"getopt" : "P:",
145e87
 		"longopt" : "project-domain",
145e87
 		"help" : "-d, --project-domain=[name]    Keystone v3 Project Domain",
6a3e49
@@ -358,14 +358,22 @@ def define_new_opts():
145e87
 		"default" : "False",
145e87
 		"order": 5,
145e87
 	}
145e87
+	all_opt["compute-domain"] = {
145e87
+		"getopt" : ":",
145e87
+		"longopt" : "compute-domain",
145e87
+		"help" : "--compute-domain=[string]      Replaced by --domain",
145e87
+		"required" : "0",
145e87
+		"shortdesc" : "Replaced by domain",
145e87
+		"order": 6,
145e87
+	}
145e87
 
145e87
 def main():
145e87
 	atexit.register(atexit_handler)
145e87
 
145e87
 	device_opt = ["login", "passwd", "tenant_name", "auth_url",
145e87
-		      "no_login", "no_password", "port", "domain", "project_domain",
145e87
-		      "user_domain", "no_shared_storage", "endpoint_type",
145e87
-		      "instance_filtering", "insecure", "region_name"]
145e87
+		      "no_login", "no_password", "port", "domain", "compute-domain",
145e87
+		      "project-domain", "user-domain", "no_shared_storage",
145e87
+		      "endpoint_type", "instance_filtering", "insecure", "region_name"]
145e87
 	define_new_opts()
145e87
 	all_opt["shell_timeout"]["default"] = "180"
145e87
 
6a3e49
@@ -380,6 +388,12 @@ def main():
145e87
 
145e87
 	run_delay(options)
145e87
 
145e87
+	# workaround to avoid regressions
145e87
+	if "--compute-domain" in options and options["--compute-domain"]:
145e87
+		options["--domain"] = options["--compute-domain"]
145e87
+		del options["--domain"]
145e87
+
145e87
+
145e87
 	connection = create_nova_connection(options)
145e87
 
145e87
 	# Un-evacuating a server doesn't make sense
6a3e49
diff --git a/tests/data/metadata/fence_compute.xml b/tests/data/metadata/fence_compute.xml
6a3e49
index e1dac97c..1dcbfc54 100644
6a3e49
--- a/tests/data/metadata/fence_compute.xml
6a3e49
+++ b/tests/data/metadata/fence_compute.xml
6a3e49
@@ -73,12 +73,22 @@
6a3e49
 		<content type="boolean" default="False"  />
6a3e49
 		<shortdesc lang="en">Allow Insecure TLS Requests</shortdesc>
6a3e49
 	</parameter>
6a3e49
-	<parameter name="project_domain" unique="0" required="0">
6a3e49
+	<parameter name="project-domain" unique="0" required="0" deprecated="1">
6a3e49
 		<getopt mixed="-d, --project-domain=[name]" />
6a3e49
 		<content type="string" default="Default"  />
6a3e49
 		<shortdesc lang="en">Keystone v3 Project Domain</shortdesc>
6a3e49
 	</parameter>
6a3e49
-	<parameter name="user_domain" unique="0" required="0">
6a3e49
+	<parameter name="project_domain" unique="0" required="0" obsoletes="project-domain">
6a3e49
+		<getopt mixed="-d, --project-domain=[name]" />
6a3e49
+		<content type="string" default="Default"  />
6a3e49
+		<shortdesc lang="en">Keystone v3 Project Domain</shortdesc>
6a3e49
+	</parameter>
6a3e49
+	<parameter name="user-domain" unique="0" required="0" deprecated="1">
6a3e49
+		<getopt mixed="-u, --user-domain=[name]" />
6a3e49
+		<content type="string" default="Default"  />
6a3e49
+		<shortdesc lang="en">Keystone v3 User Domain</shortdesc>
6a3e49
+	</parameter>
6a3e49
+	<parameter name="user_domain" unique="0" required="0" obsoletes="user-domain">
6a3e49
 		<getopt mixed="-u, --user-domain=[name]" />
6a3e49
 		<content type="string" default="Default"  />
6a3e49
 		<shortdesc lang="en">Keystone v3 User Domain</shortdesc>
6a3e49
@@ -103,6 +113,16 @@
6a3e49
 		<content type="string" default="False"  />
6a3e49
 		<shortdesc lang="en">Only record the target as needing evacuation</shortdesc>
6a3e49
 	</parameter>
6a3e49
+	<parameter name="compute-domain" unique="0" required="0" deprecated="1">
6a3e49
+		<getopt mixed="--compute-domain=[string]" />
6a3e49
+		<content type="string"  />
6a3e49
+		<shortdesc lang="en">Replaced by domain</shortdesc>
6a3e49
+	</parameter>
6a3e49
+	<parameter name="compute_domain" unique="0" required="0" obsoletes="compute-domain">
6a3e49
+		<getopt mixed="--compute-domain=[string]" />
6a3e49
+		<content type="string"  />
6a3e49
+		<shortdesc lang="en">Replaced by domain</shortdesc>
6a3e49
+	</parameter>
6a3e49
 	<parameter name="quiet" unique="0" required="0">
6a3e49
 		<getopt mixed="-q, --quiet" />
6a3e49
 		<content type="boolean"  />
6a3e49
diff --git a/tests/data/metadata/fence_evacuate.xml b/tests/data/metadata/fence_evacuate.xml
6a3e49
index 6f8bd0a4..4f1f6a58 100644
6a3e49
--- a/tests/data/metadata/fence_evacuate.xml
6a3e49
+++ b/tests/data/metadata/fence_evacuate.xml
6a3e49
@@ -73,12 +73,22 @@
6a3e49
 		<content type="boolean" default="False"  />
6a3e49
 		<shortdesc lang="en">Allow Insecure TLS Requests</shortdesc>
6a3e49
 	</parameter>
6a3e49
-	<parameter name="project_domain" unique="0" required="0">
6a3e49
+	<parameter name="project-domain" unique="0" required="0" deprecated="1">
6a3e49
 		<getopt mixed="-d, --project-domain=[name]" />
6a3e49
 		<content type="string" default="Default"  />
6a3e49
 		<shortdesc lang="en">Keystone v3 Project Domain</shortdesc>
6a3e49
 	</parameter>
6a3e49
-	<parameter name="user_domain" unique="0" required="0">
6a3e49
+	<parameter name="project_domain" unique="0" required="0" obsoletes="project-domain">
6a3e49
+		<getopt mixed="-d, --project-domain=[name]" />
6a3e49
+		<content type="string" default="Default"  />
6a3e49
+		<shortdesc lang="en">Keystone v3 Project Domain</shortdesc>
6a3e49
+	</parameter>
6a3e49
+	<parameter name="user-domain" unique="0" required="0" deprecated="1">
6a3e49
+		<getopt mixed="-u, --user-domain=[name]" />
6a3e49
+		<content type="string" default="Default"  />
6a3e49
+		<shortdesc lang="en">Keystone v3 User Domain</shortdesc>
6a3e49
+	</parameter>
6a3e49
+	<parameter name="user_domain" unique="0" required="0" obsoletes="user-domain">
6a3e49
 		<getopt mixed="-u, --user-domain=[name]" />
6a3e49
 		<content type="string" default="Default"  />
6a3e49
 		<shortdesc lang="en">Keystone v3 User Domain</shortdesc>
6a3e49
@@ -98,6 +108,16 @@
6a3e49
 		<content type="boolean" default="False"  />
6a3e49
 		<shortdesc lang="en">Disable functionality for dealing with shared storage</shortdesc>
6a3e49
 	</parameter>
6a3e49
+	<parameter name="compute-domain" unique="0" required="0" deprecated="1">
6a3e49
+		<getopt mixed="--compute-domain=[string]" />
6a3e49
+		<content type="string"  />
6a3e49
+		<shortdesc lang="en">Replaced by domain</shortdesc>
6a3e49
+	</parameter>
6a3e49
+	<parameter name="compute_domain" unique="0" required="0" obsoletes="compute-domain">
6a3e49
+		<getopt mixed="--compute-domain=[string]" />
6a3e49
+		<content type="string"  />
6a3e49
+		<shortdesc lang="en">Replaced by domain</shortdesc>
6a3e49
+	</parameter>
6a3e49
 	<parameter name="quiet" unique="0" required="0">
6a3e49
 		<getopt mixed="-q, --quiet" />
6a3e49
 		<content type="boolean"  />
6a3e49
-- 
6a3e49
2.17.1
6a3e49