Blame SOURCES/bz1214359-4-fence_compute.patch

e4ffb1
From b1e7b610b51c0be23d7adc0e2ab369850d924f87 Mon Sep 17 00:00:00 2001
e4ffb1
From: "Fabio M. Di Nitto" <fdinitto@redhat.com>
e4ffb1
Date: Mon, 8 Jun 2015 14:43:00 +0200
e4ffb1
Subject: [PATCH 4/4] compute: add support for endpoint-type
e4ffb1
e4ffb1
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
e4ffb1
---
e4ffb1
 fence/agents/compute/fence_compute.py | 14 ++++++++++++--
e4ffb1
 1 file changed, 12 insertions(+), 2 deletions(-)
e4ffb1
e4ffb1
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
e4ffb1
index c2c90fc..000aef7 100644
e4ffb1
--- a/fence/agents/compute/fence_compute.py
e4ffb1
+++ b/fence/agents/compute/fence_compute.py
e4ffb1
@@ -123,6 +123,15 @@ def get_plugs_list(_, options):
e4ffb1
 
e4ffb1
 
e4ffb1
 def define_new_opts():
e4ffb1
+	all_opt["endpoint-type"] = {
e4ffb1
+		"getopt" : "e:",
e4ffb1
+		"longopt" : "endpoint-type",
e4ffb1
+		"help" : "-e, --endpoint-type=[endpoint] Nova Endpoint type (publicURL, internalURL, adminURL)",
e4ffb1
+		"required" : "0",
e4ffb1
+		"shortdesc" : "Nova Endpoint type",
e4ffb1
+		"default" : "internalURL",
e4ffb1
+		"order": 1,
e4ffb1
+	}
e4ffb1
 	all_opt["tenant-name"] = {
e4ffb1
 		"getopt" : "t:",
e4ffb1
 		"longopt" : "tenant-name",
e4ffb1
@@ -166,7 +175,7 @@ def main():
e4ffb1
 	atexit.register(atexit_handler)
e4ffb1
 
e4ffb1
 	device_opt = ["login", "passwd", "tenant-name", "auth-url",
e4ffb1
-		"no_login", "no_password", "port", "domain", "no-shared-storage"]
e4ffb1
+		"no_login", "no_password", "port", "domain", "no-shared-storage", "endpoint-type"]
e4ffb1
 	define_new_opts()
e4ffb1
 	all_opt["shell_timeout"]["default"] = "180"
e4ffb1
 
e4ffb1
@@ -195,7 +204,8 @@ def main():
e4ffb1
 		options["--username"],
e4ffb1
 		options["--password"],
e4ffb1
 		options["--tenant-name"],
e4ffb1
-		options["--auth-url"])
e4ffb1
+		options["--auth-url"],
e4ffb1
+		endpoint_type=options["--endpoint-type"])
e4ffb1
 
e4ffb1
 	if options["--action"] in ["on", "off", "reboot" ]:
e4ffb1
 		try:
e4ffb1
-- 
e4ffb1
1.9.3
e4ffb1