Gitweb:
http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=a60ed3...
Commit: a60ed3ca6fa0f63dfb09b46d99c2a281e2eed63e
Parent: 3cc91f4c6e7aec98bd6f4e1dddaa08876ae893d0
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Sun Nov 18 13:18:34 2012 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Sun Nov 25 13:11:34 2012 +0100
fencing: Move options which are used only once to appropriate fence agent
@note: Fence agents which are going to removed/replaced were not fixed
---
fence/agents/cisco_ucs/fence_cisco_ucs.py | 12 +++++++++
fence/agents/drac5/fence_drac5.py | 13 +++++++++-
fence/agents/ilo/fence_ilo.py | 11 ++++++++
fence/agents/lib/fencing.py.py | 37 -----------------------------
fence/agents/lpar/fence_lpar.py | 19 +++++++++++++++
5 files changed, 54 insertions(+), 38 deletions(-)
diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py
b/fence/agents/cisco_ucs/fence_cisco_ucs.py
index 0260bf0..53d2a52 100644
--- a/fence/agents/cisco_ucs/fence_cisco_ucs.py
+++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py
@@ -96,11 +96,23 @@ def send_command(opt, command, timeout):
return result
+def define_new_opts():
+ all_opt["suborg"] = {
+ "getopt" : "s:",
+ "longopt" : "suborg",
+ "help" : "--suborg=<path> Additional path needed to
access suborganization",
+ "required" : "0",
+ "shortdesc" : "Additional path needed to access suborganization",
+ "default" : "",
+ "order" : 1 }
+
def main():
device_opt = [ "ipaddr", "ipport", "login",
"passwd", "ssl", \
"port", "web", "suborg" ]
atexit.register(atexit_handler)
+
+ define_new_opts()
options = check_input(device_opt, process_input(device_opt))
diff --git a/fence/agents/drac5/fence_drac5.py b/fence/agents/drac5/fence_drac5.py
index cb67179..09157fe 100644
--- a/fence/agents/drac5/fence_drac5.py
+++ b/fence/agents/drac5/fence_drac5.py
@@ -67,13 +67,24 @@ def get_list_devices(conn, options):
print "N/A"
return outlets
-
+
+def define_new_opts():
+ all_opt["drac_version"] = {
+ "getopt" : "d:",
+ "longopt" : "drac-version",
+ "help" : "-d, --drac-version=<version> Force DRAC version to
use",
+ "required" : "0",
+ "shortdesc" : "Force DRAC version to use",
+ "order" : 1 }
+
def main():
device_opt = [ "ipaddr", "ipport", "login",
"passwd", "cmd_prompt", "secure", \
"drac_version", "module_name" ]
atexit.register(atexit_handler)
+ define_new_opts()
+
all_opt["cmd_prompt"]["default"] = [ "\$" ]
options = check_input(device_opt, process_input(device_opt))
diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py
index 3fdf3c7..82e1c63 100644
--- a/fence/agents/ilo/fence_ilo.py
+++ b/fence/agents/ilo/fence_ilo.py
@@ -52,11 +52,22 @@ def set_power_status(conn, options):
return
+def define_new_opts():
+ all_opt["ribcl"] = {
+ "getopt" : "r:",
+ "longopt" : "ribcl-version",
+ "help" : "-r, --ribcl-version=<version> Force ribcl version to
use",
+ "required" : "0",
+ "shortdesc" : "Force ribcl version to use",
+ "order" : 1 }
+
def main():
device_opt = [ "ipaddr", "ipport", "login",
"passwd", "ssl", "ribcl" ]
atexit.register(atexit_handler)
+ define_new_opts()
+
all_opt["login_timeout"]["default"] = "10"
all_opt["retry_on"]["default"] = "3"
all_opt["ssl"]["default"] = "1"
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index d5c67a6..55a473e 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -155,21 +155,6 @@ all_opt = {
"required" : "0",
"shortdesc" : "Force DRAC version to use",
"order" : 1 },
- "hmc_version" : {
- "getopt" : "H:",
- "longopt" : "hmc-version",
- "help" : "-H, --hmc-version=<version> Force HMC version to use:
3, 4 (default)",
- "required" : "0",
- "shortdesc" : "Force HMC version to use (3 or 4)",
- "default" : "4",
- "order" : 1 },
- "ribcl" : {
- "getopt" : "r:",
- "longopt" : "ribcl-version",
- "help" : "-r, --ribcl-version=<version> Force ribcl version to
use",
- "required" : "0",
- "shortdesc" : "Force ribcl version to use",
- "order" : 1 },
"cmd_prompt" : {
"getopt" : "c:",
"longopt" : "command-prompt",
@@ -213,28 +198,6 @@ all_opt = {
"required" : "0",
"shortdesc" : "Physical switch number on device",
"order" : 1 },
- "suborg" : {
- "getopt" : "s:",
- "longopt" : "suborg",
- "help" : "--suborg=<path> Additional path needed to
access suborganization",
- "required" : "0",
- "shortdesc" : "Additional path needed to access suborganization",
- "default" : "",
- "order" : 1 },
- "partition" : {
- "getopt" : "n:",
- "longopt" : "partition",
- "help" : "-n <id> Name of the
partition",
- "required" : "0",
- "shortdesc" : "Partition name",
- "order" : 1 },
- "managed" : {
- "getopt" : "s:",
- "longopt" : "managed",
- "help" : "-s, --managed=<id> Name of the managed
system",
- "required" : "0",
- "shortdesc" : "Managed system name",
- "order" : 1 },
"test" : {
"getopt" : "T",
"help" : "",
diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py
index 5cedc24..9233003 100644
--- a/fence/agents/lpar/fence_lpar.py
+++ b/fence/agents/lpar/fence_lpar.py
@@ -99,12 +99,31 @@ def get_lpar_list(conn, options):
return outlets
+def define_new_opts():
+ all_opt["managed"] = {
+ "getopt" : "s:",
+ "longopt" : "managed",
+ "help" : "-s, --managed=<id> Name of the managed
system",
+ "required" : "0",
+ "shortdesc" : "Managed system name",
+ "order" : 1 }
+ all_opt["hmc_version"] = {
+ "getopt" : "H:",
+ "longopt" : "hmc-version",
+ "help" : "-H, --hmc-version=<version> Force HMC version to use:
3, 4 (default)",
+ "required" : "0",
+ "shortdesc" : "Force HMC version to use (3 or 4)",
+ "default" : "4",
+ "order" : 1 }
+
def main():
device_opt = [ "ipaddr", "ipport", "login",
"passwd", "secure", "cmd_prompt", \
"partition", "managed", "hmc_version" ]
atexit.register(atexit_handler)
+ define_new_opts()
+
all_opt["login_timeout"]["default"] = "15"
all_opt["secure"]["default"] = "1"
all_opt["cmd_prompt"]["default"] = [ ":~>",
"]\$", "\$ " ]