From 46d0346ee0c1c39d418fc2ae2f06d6d30a7daa33 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Fri, 23 Mar 2018 15:14:52 +0100
Subject: [PATCH] fence_compute/fence_evacuate: revert to old parameters

---
 fence/agents/compute/fence_compute.py   |  8 ++++----
 fence/agents/evacuate/fence_evacuate.py | 10 +++++-----
 tests/data/metadata/fence_compute.xml   | 21 +++------------------
 tests/data/metadata/fence_evacuate.xml  | 21 +++------------------
 4 files changed, 15 insertions(+), 45 deletions(-)

diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
index 45f368e8..ec2d093c 100644
--- a/fence/agents/compute/fence_compute.py
+++ b/fence/agents/compute/fence_compute.py
@@ -353,7 +353,7 @@ def define_new_opts():
 		"default" : "",
 		"order": 1,
 	}
-	all_opt["user-domain"] = {
+	all_opt["user_domain"] = {
 		"getopt" : "u:",
 		"longopt" : "user-domain",
 		"help" : "-u, --user-domain=[name]       Keystone v3 User Domain",
@@ -362,7 +362,7 @@ def define_new_opts():
 		"default" : "Default",
 		"order": 2,
 	}
-	all_opt["project-domain"] = {
+	all_opt["project_domain"] = {
 		"getopt" : "P:",
 		"longopt" : "project-domain",
 		"help" : "-d, --project-domain=[name]    Keystone v3 Project Domain",
@@ -398,7 +398,7 @@ def define_new_opts():
 		"default" : "False",
 		"order": 2,
 	}
-	all_opt["compute-domain"] = {
+	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",
@@ -451,7 +451,7 @@ def main():
 	atexit.register(atexit_handler)
 
 	device_opt = ["login", "passwd", "tenant_name", "auth_url", "fabric_fencing",
-		      "no_login", "no_password", "port", "compute-domain", "project-domain", "user-domain",
+		      "no_login", "no_password", "port", "domain", "project_domain", "user_domain",
 		      "no_shared_storage", "endpoint_type", "record_only", "instance_filtering", "insecure", "region_name"]
 	define_new_opts()
 	all_opt["shell_timeout"]["default"] = "180"
diff --git a/fence/agents/evacuate/fence_evacuate.py b/fence/agents/evacuate/fence_evacuate.py
index f39df273..615dede7 100644
--- a/fence/agents/evacuate/fence_evacuate.py
+++ b/fence/agents/evacuate/fence_evacuate.py
@@ -287,7 +287,7 @@ def define_new_opts():
 		"default" : "",
 		"order": 1,
 	}
-	all_opt["user-domain"] = {
+	all_opt["user_domain"] = {
 		"getopt" : "u:",
 		"longopt" : "user-domain",
 		"help" : "-u, --user-domain=[name]       Keystone v3 User Domain",
@@ -296,7 +296,7 @@ def define_new_opts():
 		"default" : "Default",
 		"order": 2,
 	}
-	all_opt["project-domain"] = {
+	all_opt["project_domain"] = {
 		"getopt" : "P:",
 		"longopt" : "project-domain",
 		"help" : "-d, --project-domain=[name]    Keystone v3 Project Domain",
@@ -332,7 +332,7 @@ def define_new_opts():
 		"default" : "False",
 		"order": 2,
 	}
-	all_opt["compute-domain"] = {
+	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",
@@ -363,8 +363,8 @@ def main():
 	atexit.register(atexit_handler)
 
 	device_opt = ["login", "passwd", "tenant_name", "auth_url",
-		      "no_login", "no_password", "port", "compute-domain", "project-domain",
-		      "user-domain", "no_shared_storage", "endpoint_type",
+		      "no_login", "no_password", "port", "domain", "project_domain",
+		      "user_domain", "no_shared_storage", "endpoint_type",
 		      "instance_filtering", "insecure", "region_name"]
 	define_new_opts()
 	all_opt["shell_timeout"]["default"] = "180"
diff --git a/tests/data/metadata/fence_compute.xml b/tests/data/metadata/fence_compute.xml
index 962a1adc..e1dac97c 100644
--- a/tests/data/metadata/fence_compute.xml
+++ b/tests/data/metadata/fence_compute.xml
@@ -73,32 +73,17 @@
 		<content type="boolean" default="False"  />
 		<shortdesc lang="en">Allow Insecure TLS Requests</shortdesc>
 	</parameter>
-	<parameter name="project-domain" unique="0" required="0" deprecated="1">
+	<parameter name="project_domain" unique="0" required="0">
 		<getopt mixed="-d, --project-domain=[name]" />
 		<content type="string" default="Default"  />
 		<shortdesc lang="en">Keystone v3 Project Domain</shortdesc>
 	</parameter>
-	<parameter name="project_domain" unique="0" required="0" obsoletes="project-domain">
-		<getopt mixed="-d, --project-domain=[name]" />
-		<content type="string" default="Default"  />
-		<shortdesc lang="en">Keystone v3 Project Domain</shortdesc>
-	</parameter>
-	<parameter name="user-domain" unique="0" required="0" deprecated="1">
-		<getopt mixed="-u, --user-domain=[name]" />
-		<content type="string" default="Default"  />
-		<shortdesc lang="en">Keystone v3 User Domain</shortdesc>
-	</parameter>
-	<parameter name="user_domain" unique="0" required="0" obsoletes="user-domain">
+	<parameter name="user_domain" unique="0" required="0">
 		<getopt mixed="-u, --user-domain=[name]" />
 		<content type="string" default="Default"  />
 		<shortdesc lang="en">Keystone v3 User Domain</shortdesc>
 	</parameter>
-	<parameter name="compute-domain" unique="0" required="0" deprecated="1">
-		<getopt mixed="-d, --domain=[string]" />
-		<content type="string"  />
-		<shortdesc lang="en">DNS domain in which hosts live</shortdesc>
-	</parameter>
-	<parameter name="domain" unique="0" required="0" obsoletes="compute-domain">
+	<parameter name="domain" unique="0" required="0">
 		<getopt mixed="-d, --domain=[string]" />
 		<content type="string"  />
 		<shortdesc lang="en">DNS domain in which hosts live</shortdesc>
diff --git a/tests/data/metadata/fence_evacuate.xml b/tests/data/metadata/fence_evacuate.xml
index 38bac98c..6f8bd0a4 100644
--- a/tests/data/metadata/fence_evacuate.xml
+++ b/tests/data/metadata/fence_evacuate.xml
@@ -73,32 +73,17 @@
 		<content type="boolean" default="False"  />
 		<shortdesc lang="en">Allow Insecure TLS Requests</shortdesc>
 	</parameter>
-	<parameter name="project-domain" unique="0" required="0" deprecated="1">
+	<parameter name="project_domain" unique="0" required="0">
 		<getopt mixed="-d, --project-domain=[name]" />
 		<content type="string" default="Default"  />
 		<shortdesc lang="en">Keystone v3 Project Domain</shortdesc>
 	</parameter>
-	<parameter name="project_domain" unique="0" required="0" obsoletes="project-domain">
-		<getopt mixed="-d, --project-domain=[name]" />
-		<content type="string" default="Default"  />
-		<shortdesc lang="en">Keystone v3 Project Domain</shortdesc>
-	</parameter>
-	<parameter name="user-domain" unique="0" required="0" deprecated="1">
-		<getopt mixed="-u, --user-domain=[name]" />
-		<content type="string" default="Default"  />
-		<shortdesc lang="en">Keystone v3 User Domain</shortdesc>
-	</parameter>
-	<parameter name="user_domain" unique="0" required="0" obsoletes="user-domain">
+	<parameter name="user_domain" unique="0" required="0">
 		<getopt mixed="-u, --user-domain=[name]" />
 		<content type="string" default="Default"  />
 		<shortdesc lang="en">Keystone v3 User Domain</shortdesc>
 	</parameter>
-	<parameter name="compute-domain" unique="0" required="0" deprecated="1">
-		<getopt mixed="-d, --domain=[string]" />
-		<content type="string"  />
-		<shortdesc lang="en">DNS domain in which hosts live</shortdesc>
-	</parameter>
-	<parameter name="domain" unique="0" required="0" obsoletes="compute-domain">
+	<parameter name="domain" unique="0" required="0">
 		<getopt mixed="-d, --domain=[string]" />
 		<content type="string"  />
 		<shortdesc lang="en">DNS domain in which hosts live</shortdesc>
-- 
2.13.6

