fence-agents/0002-fence_compute-Add-region-name-command-line-argument.patch

68 lines
2.3 KiB
Diff
Raw Normal View History

From 16d9f9108897c9335e759667ae091162c911cb08 Mon Sep 17 00:00:00 2001
From: Vincent Untz <vuntz@suse.com>
Date: Thu, 7 Jan 2016 22:17:51 +0100
Subject: [PATCH 2/8] fence_compute: Add --region-name command line argument
Useful for multi-region setups.
---
fence/agents/compute/fence_compute.py | 12 +++++++++++-
tests/data/metadata/fence_compute.xml | 5 +++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
index ef066d4..d1d797e 100644
--- a/fence/agents/compute/fence_compute.py
+++ b/fence/agents/compute/fence_compute.py
@@ -242,6 +242,15 @@ def define_new_opts():
"default" : "",
"order": 1,
}
+ all_opt["region-name"] = {
+ "getopt" : "",
+ "longopt" : "region-name",
+ "help" : "--region-name=[region] Region Name",
+ "required" : "0",
+ "shortdesc" : "Region Name",
+ "default" : "",
+ "order": 1,
+ }
all_opt["insecure"] = {
"getopt" : "",
"longopt" : "insecure",
@@ -295,7 +304,7 @@ def main():
device_opt = ["login", "passwd", "tenant-name", "auth-url", "fabric_fencing", "on_target",
"no_login", "no_password", "port", "domain", "no-shared-storage", "endpoint-type",
- "record-only", "instance-filtering", "insecure"]
+ "record-only", "instance-filtering", "insecure", "region-name"]
define_new_opts()
all_opt["shell_timeout"]["default"] = "180"
@@ -341,6 +350,7 @@ def main():
options["--tenant-name"],
options["--auth-url"],
insecure=options["--insecure"],
+ region_name=options["--region-name"],
endpoint_type=options["--endpoint-type"])
if options["--action"] in ["off", "reboot"]:
diff --git a/tests/data/metadata/fence_compute.xml b/tests/data/metadata/fence_compute.xml
index 5aeae40..e5c112c 100644
--- a/tests/data/metadata/fence_compute.xml
+++ b/tests/data/metadata/fence_compute.xml
@@ -38,6 +38,11 @@
<content type="string" />
<shortdesc lang="en">Physical plug number on device, UUID or identification of machine</shortdesc>
</parameter>
+ <parameter name="region-name" unique="0" required="0">
+ <getopt mixed="--region-name=[region]" />
+ <content type="boolean" default="" />
+ <shortdesc lang="en">Region Name</shortdesc>
+ </parameter>
<parameter name="tenant-name" unique="0" required="0">
<getopt mixed="-t, --tenant-name=[tenant]" />
<content type="string" default="" />
--
2.6.2