fence-agents: master - fencing: Available actions in --help where not always up-to-date

Marek GrĂ¡c marx at fedoraproject.org
Thu Oct 23 15:27:39 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=e59a87f1f518dffb09469a30a8c62596d10fdfa4
Commit:        e59a87f1f518dffb09469a30a8c62596d10fdfa4
Parent:        c5ed2256e572bd06e8bf4ca00d6c891424ae4b00
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Thu Oct 23 17:25:39 2014 +0200
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Thu Oct 23 17:25:39 2014 +0200

fencing: Available actions in --help where not always up-to-date

Previously, we have different help text for action only for fabric fencing (no-reboot). But
we have fence agents that do not have 'status' action e.g. fence_ovh. With this update,
the help text is always accurate.
---
 fence/agents/lib/fencing.py.py  |   10 ++++++++--
 fence/agents/ovh/fence_ovh.py   |    1 -
 fence/agents/scsi/fence_scsi.py |    2 --
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 640f81a..33bb306 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -648,7 +648,6 @@ def process_input(avail_opt):
 ## password script to set a correct password
 ######
 def check_input(device_opt, opt):
-
 	device_opt.extend(add_dependency_options(device_opt))
 
 	options = dict(opt)
@@ -663,7 +662,14 @@ def check_input(device_opt, opt):
 
 	if device_opt.count("fabric_fencing"):
 		all_opt["action"]["default"] = "off"
-		all_opt["action"]["help"] = "-o, --action=[action]          Action: status, off (default) or on"
+		if device_opt.count("no_status"):
+			all_opt["action"]["help"] = "-o, --action=[action]          Action: off (default) or on"
+		else:
+			all_opt["action"]["help"] = "-o, --action=[action]          Action: status, off (default) or on"
+	else:
+		if device_opt.count("no_status"):
+			all_opt["action"]["help"] = "-o, --action=[action]          Action: reboot (default), off or on"
+
 
 	if device_opt.count("ipport"):
 		if options.has_key("--ipport"):
diff --git a/fence/agents/ovh/fence_ovh.py b/fence/agents/ovh/fence_ovh.py
index 170df11..fa23969 100644
--- a/fence/agents/ovh/fence_ovh.py
+++ b/fence/agents/ovh/fence_ovh.py
@@ -82,7 +82,6 @@ def main():
 	atexit.register(atexit_handler)
 
 	define_new_opts()
-	all_opt["action"]["help"] = "-o, --action=[action]          Action: reboot (default), off or on"
 	options = check_input(device_opt, process_input(device_opt))
 
 	docs = {}
diff --git a/fence/agents/scsi/fence_scsi.py b/fence/agents/scsi/fence_scsi.py
index d22bb86..ae960cc 100644
--- a/fence/agents/scsi/fence_scsi.py
+++ b/fence/agents/scsi/fence_scsi.py
@@ -382,8 +382,6 @@ def main():
 
 	define_new_opts()
 
-	all_opt["action"]["help"] = "-o, --action=[action]          Action: status, off (default) or on"
-	all_opt["action"]["default"] = "off"
 	all_opt["delay"]["getopt"] = "H:"
 
 	#fence_scsi_check


More information about the cluster-commits mailing list