This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: RHEL5 - fence_wti: #508262 - Fence agent for WTI ends withtraceback when option is missing


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6442d9f60e650fc6669e6422207f27a073aca8ac
Commit:        6442d9f60e650fc6669e6422207f27a073aca8ac
Parent:        fcbbc9d89f025bf4d0090becdb8494800af19209
Author:        Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate:    Fri Jun 26 13:25:17 2009 +0200
Committer:     Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Fri Jun 26 13:29:51 2009 +0200

fence_wti: #508262 - Fence agent for WTI ends with traceback when option is missing

Login name/password are NOT required for WTI, so they have to be checked after
login/password is encountered.
---
 fence/agents/wti/fence_wti.py |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index c536ecc..4a5c758 100755
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -92,12 +92,18 @@ def main():
 
 			result = conn.log_expect(options, [ re_login, "Password: ", re_prompt ], SHELL_TIMEOUT)
 			if result == 0:
-				conn.send(options["-l"]+"\r\n")
-				result = conn.log_expect(options, [ re_login, "Password: ", re_prompt ], SHELL_TIMEOUT)
+				if options.has_key("-l"):
+					conn.send(options["-l"]+"\r\n")
+					result = conn.log_expect(options, [ re_login, "Password: ", re_prompt ], SHELL_TIMEOUT)
+				else:
+					fail_usage("Failed: You have to set login name")
 		
 			if result == 1:
-				conn.send(options["-p"]+"\r\n")
-				conn.log_expect(options, options["-c"], SHELL_TIMEOUT)	
+				if options.has_key("-p"):
+					conn.send(options["-p"]+"\r\n")
+					conn.log_expect(options, options["-c"], SHELL_TIMEOUT)	
+				else:
+					fail_usage("Failed: You have to enter password or password script")
 		except pexpect.EOF:
 			fail(EC_LOGIN_DENIED) 
 		except pexpect.TIMEOUT:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]