[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [fence-agents][PATCH] multiple cases: demote default cmd_prompt from a list if possible



This leads to less confusing defaults described in respective man pages.
Note that there is no way to specify a Python list manually in case
of explicitly redefining this default value.

This demotion is possible as pexpect.spawn:expect can handled both list
and single string/compiled re as a pattern argument [1].

[1] http://pexpect.sourceforge.net/pexpect.html#spawn-expect

NB: there can be more instances similar to cmd_prompt value,
    haven't checked though.

Signed-off-by: Jan Pokorný <jpokorny redhat com>
---
 fence/agents/alom/fence_alom.py               | 2 +-
 fence/agents/bladecenter/fence_bladecenter.py | 2 +-
 fence/agents/drac/fence_drac.py               | 6 +++---
 fence/agents/drac5/fence_drac5.py             | 2 +-
 fence/agents/hds_cb/fence_hds_cb.py           | 2 +-
 fence/agents/hpblade/fence_hpblade.py         | 2 +-
 fence/agents/ldom/fence_ldom.py               | 2 +-
 fence/agents/rsa/fence_rsa.py                 | 2 +-
 fence/agents/rsb/fence_rsb.py                 | 2 +-
 fence/agents/sanbox2/fence_sanbox2.py         | 2 +-
 fence/agents/virsh/fence_virsh.py             | 2 +-
 11 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fence/agents/alom/fence_alom.py b/fence/agents/alom/fence_alom.py
index ef2db3c..9c58a70 100644
--- a/fence/agents/alom/fence_alom.py
+++ b/fence/agents/alom/fence_alom.py
@@ -36,7 +36,7 @@ def main():
 	atexit.register(atexit_handler)
 
 	all_opt["secure"]["default"] = "1"
-	all_opt["cmd_prompt"]["default"] = [ "sc\>\ " ]
+	all_opt["cmd_prompt"]["default"] = "sc\>\ "
 
 	options = check_input(device_opt, process_input(device_opt))
 	options["telnet_over_ssh"] = 1
diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py
index 43c5076..ffd3f35 100644
--- a/fence/agents/bladecenter/fence_bladecenter.py
+++ b/fence/agents/bladecenter/fence_bladecenter.py
@@ -84,7 +84,7 @@ def main():
 	atexit.register(atexit_handler)
 
 	all_opt["power_wait"]["default"] = "10"
-	all_opt["cmd_prompt"]["default"] = [ "system>" ]
+	all_opt["cmd_prompt"]["default"] = "system>"
 
 	options = check_input(device_opt, process_input(device_opt))
 
diff --git a/fence/agents/drac/fence_drac.py b/fence/agents/drac/fence_drac.py
index c690b21..470a531 100644
--- a/fence/agents/drac/fence_drac.py
+++ b/fence/agents/drac/fence_drac.py
@@ -32,10 +32,10 @@ def main():
 
 	opt = process_input(device_opt)
 	if "--username" in opt:
-		all_opt["cmd_prompt"]["default"] = [ "\\[" + opt["--username"] + "\\]# " ]
+		all_opt["cmd_prompt"]["default"] = "\\[" + opt["--username"] + "\\]# "
 	else:
-		all_opt["cmd_prompt"]["default"] = [ "\\[" "username" + "\\]# " ]
-	
+		all_opt["cmd_prompt"]["default"] = "\\[" "username" + "\\]# "
+
 	options = check_input(device_opt, opt)
 
 	docs = { }
diff --git a/fence/agents/drac5/fence_drac5.py b/fence/agents/drac5/fence_drac5.py
index 2e9a8d3..bc62175 100644
--- a/fence/agents/drac5/fence_drac5.py
+++ b/fence/agents/drac5/fence_drac5.py
@@ -92,7 +92,7 @@ def main():
 
 	define_new_opts()
 
-	all_opt["cmd_prompt"]["default"] = [ "\$" ]
+	all_opt["cmd_prompt"]["default"] = "\$"
 
 	options = check_input(device_opt, process_input(device_opt))
 
diff --git a/fence/agents/hds_cb/fence_hds_cb.py b/fence/agents/hds_cb/fence_hds_cb.py
index 0e15af3..ed7d678 100755
--- a/fence/agents/hds_cb/fence_hds_cb.py
+++ b/fence/agents/hds_cb/fence_hds_cb.py
@@ -113,7 +113,7 @@ def main():
 	atexit.register(atexit_handler)
 
 	all_opt["power_wait"]["default"] = "5"
-	all_opt["cmd_prompt"]["default"] = [ "\) :" ]
+	all_opt["cmd_prompt"]["default"] = "\) :"
 
 	options = check_input(device_opt, process_input(device_opt))
 
diff --git a/fence/agents/hpblade/fence_hpblade.py b/fence/agents/hpblade/fence_hpblade.py
index 42f5309..7d08e6a 100644
--- a/fence/agents/hpblade/fence_hpblade.py
+++ b/fence/agents/hpblade/fence_hpblade.py
@@ -61,7 +61,7 @@ def main():
 
 	atexit.register(atexit_handler)
 
-	all_opt["cmd_prompt"]["default"] = [ "c7000oa>" ]
+	all_opt["cmd_prompt"]["default"] = "c7000oa>"
 
 	options = check_input(device_opt, process_input(device_opt))
 
diff --git a/fence/agents/ldom/fence_ldom.py b/fence/agents/ldom/fence_ldom.py
index 722bfda..839687c 100644
--- a/fence/agents/ldom/fence_ldom.py
+++ b/fence/agents/ldom/fence_ldom.py
@@ -74,7 +74,7 @@ def main():
 	atexit.register(atexit_handler)
 
 	all_opt["secure"]["default"] = "1"
-	all_opt["cmd_prompt"]["default"] = [ "\ $" ]
+	all_opt["cmd_prompt"]["default"] = "\ $"
 
 	options = check_input(device_opt, process_input(device_opt))
 
diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py
index 117dd67..dac9c62 100644
--- a/fence/agents/rsa/fence_rsa.py
+++ b/fence/agents/rsa/fence_rsa.py
@@ -39,7 +39,7 @@ def main():
 	atexit.register(atexit_handler)
 
 	all_opt["login_timeout"]["default"] = 10
-	all_opt["cmd_prompt"]["default"] = [ ">" ]
+	all_opt["cmd_prompt"]["default"] = ">"
 	# This device will not allow us to login even with LANG=C
 	all_opt["ssh_options"]["default"] = "-F /dev/null"
 
diff --git a/fence/agents/rsb/fence_rsb.py b/fence/agents/rsb/fence_rsb.py
index 1da186f..afff135 100755
--- a/fence/agents/rsb/fence_rsb.py
+++ b/fence/agents/rsb/fence_rsb.py
@@ -41,7 +41,7 @@ def main():
 
 	atexit.register(atexit_handler)
 
-	all_opt["cmd_prompt"]["default"] = [ "to quit:" ]
+	all_opt["cmd_prompt"]["default"] =  "to quit:"
 
 	opt = process_input(device_opt)
 
diff --git a/fence/agents/sanbox2/fence_sanbox2.py b/fence/agents/sanbox2/fence_sanbox2.py
index 5221d49..e6f869a 100644
--- a/fence/agents/sanbox2/fence_sanbox2.py
+++ b/fence/agents/sanbox2/fence_sanbox2.py
@@ -104,7 +104,7 @@ def main():
 
 	atexit.register(atexit_handler)
 
-	all_opt["cmd_prompt"]["default"] = [ " #> " ]
+	all_opt["cmd_prompt"]["default"] = " #> "
 
 	options = check_input(device_opt, process_input(device_opt))
 
diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py
index ccbd6e2..eb57c21 100644
--- a/fence/agents/virsh/fence_virsh.py
+++ b/fence/agents/virsh/fence_virsh.py
@@ -64,7 +64,7 @@ def main():
 	atexit.register(atexit_handler)
 
 	all_opt["secure"]["default"] = "1"
-	all_opt["cmd_prompt"]["default"] = [ "\[EXPECT\]#\ " ]
+	all_opt["cmd_prompt"]["default"] = "\[EXPECT\]#\ "
 	all_opt["ssh_options"]["default"] = "-t '/bin/bash -c \"PS1=\[EXPECT\]#\  /bin/bash --noprofile --norc\"'"
 
 	options = check_input(device_opt, process_input(device_opt))
-- 
1.8.1.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]