Blob Blame History Raw
From b1e7b610b51c0be23d7adc0e2ab369850d924f87 Mon Sep 17 00:00:00 2001
From: "Fabio M. Di Nitto" <fdinitto@redhat.com>
Date: Mon, 8 Jun 2015 14:43:00 +0200
Subject: [PATCH 4/4] compute: add support for endpoint-type

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 fence/agents/compute/fence_compute.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
index c2c90fc..000aef7 100644
--- a/fence/agents/compute/fence_compute.py
+++ b/fence/agents/compute/fence_compute.py
@@ -123,6 +123,15 @@ def get_plugs_list(_, options):
 
 
 def define_new_opts():
+	all_opt["endpoint-type"] = {
+		"getopt" : "e:",
+		"longopt" : "endpoint-type",
+		"help" : "-e, --endpoint-type=[endpoint] Nova Endpoint type (publicURL, internalURL, adminURL)",
+		"required" : "0",
+		"shortdesc" : "Nova Endpoint type",
+		"default" : "internalURL",
+		"order": 1,
+	}
 	all_opt["tenant-name"] = {
 		"getopt" : "t:",
 		"longopt" : "tenant-name",
@@ -166,7 +175,7 @@ def main():
 	atexit.register(atexit_handler)
 
 	device_opt = ["login", "passwd", "tenant-name", "auth-url",
-		"no_login", "no_password", "port", "domain", "no-shared-storage"]
+		"no_login", "no_password", "port", "domain", "no-shared-storage", "endpoint-type"]
 	define_new_opts()
 	all_opt["shell_timeout"]["default"] = "180"
 
@@ -195,7 +204,8 @@ def main():
 		options["--username"],
 		options["--password"],
 		options["--tenant-name"],
-		options["--auth-url"])
+		options["--auth-url"],
+		endpoint_type=options["--endpoint-type"])
 
 	if options["--action"] in ["on", "off", "reboot" ]:
 		try:
-- 
1.9.3