multiple cases: demote default cmd_prompt from a list if possible
PATCH 1/1 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? <[email protected]>
--- 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(-)
fence/agents/alom/fence_alom.py +1 -1
@@ -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
fence/agents/bladecenter/fence_bladecenter.py +1 -1
@@ -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))
fence/agents/drac/fence_drac.py +3 -3
@@ -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 = { }
fence/agents/drac5/fence_drac5.py +1 -1
@@ -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))
fence/agents/hds_cb/fence_hds_cb.py +1 -1
@@ -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))
fence/agents/hpblade/fence_hpblade.py +1 -1
@@ -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))
fence/agents/ldom/fence_ldom.py +1 -1
@@ -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))
fence/agents/rsa/fence_rsa.py +1 -1
@@ -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"
fence/agents/rsb/fence_rsb.py +1 -1
@@ -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)
fence/agents/sanbox2/fence_sanbox2.py +1 -1
@@ -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))
fence/agents/virsh/fence_virsh.py +1 -1
@@ -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))
Signature · 1 line
1.8.1.4