public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: "Marek Grác" <marx@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: STABLE2 - fence_wti: Fence agent for WTI ends with traceback when option is missing
Date: Fri, 26 Jun 2009 11:31:00 -0000 [thread overview]
Message-ID: <20090626113116.6DA201201EE@lists.fedorahosted.org> (raw)
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=3ec98b77e3fad4b81e2d14b01c5a25e97521ef50
Commit: 3ec98b77e3fad4b81e2d14b01c5a25e97521ef50
Parent: 82861a63cff294b63736c75d973469c600ae2a44
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:27:47 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.
---
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 54c037f..30b41a1 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -91,12 +91,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:
reply other threads:[~2009-06-26 11:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090626113116.6DA201201EE@lists.fedorahosted.org \
--to=marx@fedoraproject.org \
--cc=cluster-cvs-relay@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).