Gitweb:
http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=a90a90...
Commit: a90a90cf56f713be9a4064a02c0f630425b2091c
Parent: a6f6979c26b474ac0ef2695a39e45fcf26fa57f2
Author: Ondrej Mular <omular(a)redhat.com>
AuthorDate: Fri Mar 7 09:43:00 2014 -0500
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Mar 12 16:44:59 2014 +0100
fencing: fixed pexpect TypeError exception, when using identity file for login via ssh
Previously, fence-agent failed to log in (ssh) using identity file. This caused
fence-agent failure because of uncaught exception.
Resolves: rhbz#1073947
Signed-off-by: Marek 'marx' Grac <mgrac(a)redhat.com>
---
fence/agents/lib/fencing.py.py | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 2006f0d..76855e1 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -1022,13 +1022,12 @@ def fence_login(options, re_login_string = "(login\s*:
)|(Login Name: )|(userna
"are not in the spec file and must be installed separately." +
"\n")
sys.exit(EC_GENERIC_ERROR)
- result = conn.log_expect(options, [ options["--command-prompt"], \
- "Are you sure you want to continue connecting (yes/no)?", \
- "Enter passphrase for key '" + options["--identity-file"] +
"':" ], int(options["--login-timeout"]))
+ result = conn.log_expect(options, [ "Enter passphrase for key '" +
options["--identity-file"] + "':",\
+ "Are you sure you want to continue connecting (yes/no)?" ] +
options["--command-prompt"], int(options["--login-timeout"]))
if result == 1:
conn.sendline("yes")
- conn.log_expect(options, [ options["--command-prompt"], "Enter
passphrase for key '"+options["--identity-file"]+"':"] ,
int(options["--login-timeout"]))
- if result != 0:
+ result = conn.log_expect(options, [ "Enter passphrase for key
'"+options["--identity-file"]+"':"] +
options["--command-prompt"], int(options["--login-timeout"]))
+ if result == 0:
if options.has_key("--password"):
conn.sendline(options["--password"])
conn.log_expect(options, options["--command-prompt"],
int(options["--login-timeout"]))