public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* fence-agents: master - fence_wti: Fence agent for WTI ends with traceback when option is missing
@ 2009-06-26 11:39 Marek Grác
0 siblings, 0 replies; only message in thread
From: Marek Grác @ 2009-06-26 11:39 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=b0913e9ff4b7a2be3895577ae5d54d44a6bfb067
Commit: b0913e9ff4b7a2be3895577ae5d54d44a6bfb067
Parent: d35a9f675801ba1926a98b1f074ee5445560fa91
Author: Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate: Fri Jun 26 13:34:15 2009 +0200
Committer: Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Fri Jun 26 13:34:15 2009 +0200
fence_wti: 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. Please enter the commit message for your changes.
bz#508262
---
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 9f5d59f..35b4d54 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -101,12 +101,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:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-06-26 11:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-26 11:39 fence-agents: master - fence_wti: Fence agent for WTI ends with traceback when option is missing Marek Grác
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).