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

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