From 4b06b842e57f80bda87ec57b9e0e047fe89ad25f Mon Sep 17 00:00:00 2001 From: Marek 'marx' Grac Date: Wed, 26 Aug 2015 12:54:47 +0200 Subject: [PATCH 2/3] fence_ipmilan: Re-introduce -t / timeout option In the new fence agent this option was replaced by --*-timeout but old option should work as before. It sets all *-timeout to a value 'timeout' Resolves: rhbz#1257137 --- fence/agents/ipmilan/fence_ipmilan.py | 16 +++++++++++++++- tests/data/metadata/fence_idrac.xml | 23 ++++++++++++++--------- tests/data/metadata/fence_ilo3.xml | 23 ++++++++++++++--------- tests/data/metadata/fence_ilo4.xml | 23 ++++++++++++++--------- tests/data/metadata/fence_imm.xml | 23 ++++++++++++++--------- tests/data/metadata/fence_ipmilan.xml | 23 ++++++++++++++--------- 6 files changed, 85 insertions(+), 46 deletions(-) diff --git a/fence/agents/ipmilan/fence_ipmilan.py b/fence/agents/ipmilan/fence_ipmilan.py index 8224b83..fd04110 100644 --- a/fence/agents/ipmilan/fence_ipmilan.py +++ b/fence/agents/ipmilan/fence_ipmilan.py @@ -125,12 +125,21 @@ def define_new_opts(): "help" : "", "order" : 1 } + all_opt["timeout"] = { + "getopt" : "t:", + "longopt" : "timeout", + "help" : "-t [seconds] Timeout (sec) for IPMI operation", + "required" : "0", + "shortdesc" : "Timeout (sec) for IPMI operation", + "order" : 1 + } def main(): atexit.register(atexit_handler) device_opt = ["ipaddr", "ipport", "login", "no_login", "no_password", "passwd", - "lanplus", "auth", "cipher", "privlvl", "sudo", "ipmitool_path", "method", "obsolete_ip"] + "lanplus", "auth", "cipher", "privlvl", "sudo", "ipmitool_path", "method", + "obsolete_ip", "timeout"] define_new_opts() if os.path.basename(sys.argv[0]) == "fence_ilo3": @@ -148,6 +157,11 @@ def main(): pi["--ip"] = pi["--obsolete-ip"] options = check_input(device_opt, pi) + if "--timeout" in options: + options["--shell-timeout"] = options["--timeout"] + options["--power-timeout"] = options["--timeout"] + options["--login-timeout"] = options["--timeout"] + docs = {} docs["shortdesc"] = "Fence agent for IPMI" docs["longdesc"] = "fence_ipmilan is an I/O Fencing agent\ diff --git a/tests/data/metadata/fence_idrac.xml b/tests/data/metadata/fence_idrac.xml index 0aced2a..6e0b834 100644 --- a/tests/data/metadata/fence_idrac.xml +++ b/tests/data/metadata/fence_idrac.xml @@ -64,6 +64,11 @@ IPMI Lan Auth type. + + + + Fencing Action + @@ -79,10 +84,10 @@ Privilege level on IPMI device - - - - Fencing Action + + + + Timeout (sec) for IPMI operation @@ -119,16 +124,16 @@ Wait X seconds for cmd prompt after login - - - - Test X seconds for status change after ON/OFF - Wait X seconds before fencing is started + + + + Test X seconds for status change after ON/OFF + diff --git a/tests/data/metadata/fence_ilo3.xml b/tests/data/metadata/fence_ilo3.xml index 67e869b..1253539 100644 --- a/tests/data/metadata/fence_ilo3.xml +++ b/tests/data/metadata/fence_ilo3.xml @@ -64,6 +64,11 @@ IPMI Lan Auth type. + + + + Fencing Action + @@ -79,10 +84,10 @@ Privilege level on IPMI device - - - - Fencing Action + + + + Timeout (sec) for IPMI operation @@ -119,16 +124,16 @@ Wait X seconds for cmd prompt after login - - - - Test X seconds for status change after ON/OFF - Wait X seconds before fencing is started + + + + Test X seconds for status change after ON/OFF + diff --git a/tests/data/metadata/fence_ilo4.xml b/tests/data/metadata/fence_ilo4.xml index b7dd31a..6498be8 100644 --- a/tests/data/metadata/fence_ilo4.xml +++ b/tests/data/metadata/fence_ilo4.xml @@ -64,6 +64,11 @@ IPMI Lan Auth type. + + + + Fencing Action + @@ -79,10 +84,10 @@ Privilege level on IPMI device - - - - Fencing Action + + + + Timeout (sec) for IPMI operation @@ -119,16 +124,16 @@ Wait X seconds for cmd prompt after login - - - - Test X seconds for status change after ON/OFF - Wait X seconds before fencing is started + + + + Test X seconds for status change after ON/OFF + diff --git a/tests/data/metadata/fence_imm.xml b/tests/data/metadata/fence_imm.xml index 0e7588d..e6d67bc 100644 --- a/tests/data/metadata/fence_imm.xml +++ b/tests/data/metadata/fence_imm.xml @@ -64,6 +64,11 @@ IPMI Lan Auth type. + + + + Fencing Action + @@ -79,10 +84,10 @@ Privilege level on IPMI device - - - - Fencing Action + + + + Timeout (sec) for IPMI operation @@ -119,16 +124,16 @@ Wait X seconds for cmd prompt after login - - - - Test X seconds for status change after ON/OFF - Wait X seconds before fencing is started + + + + Test X seconds for status change after ON/OFF + diff --git a/tests/data/metadata/fence_ipmilan.xml b/tests/data/metadata/fence_ipmilan.xml index 443365c..97edfbb 100644 --- a/tests/data/metadata/fence_ipmilan.xml +++ b/tests/data/metadata/fence_ipmilan.xml @@ -64,6 +64,11 @@ IPMI Lan Auth type. + + + + Fencing Action + @@ -79,10 +84,10 @@ Privilege level on IPMI device - - - - Fencing Action + + + + Timeout (sec) for IPMI operation @@ -119,16 +124,16 @@ Wait X seconds for cmd prompt after login - - - - Test X seconds for status change after ON/OFF - Wait X seconds before fencing is started + + + + Test X seconds for status change after ON/OFF + -- 1.9.3