cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Ondrej Mular <omular@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] fencing: fixed pexpect TypeError exception, when using identity file for login via ssh
Date: Fri, 7 Mar 2014 09:43:00 -0500 (EST)	[thread overview]
Message-ID: <1453301325.11644723.1394203380048.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <302229747.11643904.1394203224564.JavaMail.zimbra@redhat.com>

Previously, fence-agent failed to log in (ssh) using identity file. This caused fence-agent failure because of uncaught exception.

Resolves: rhbz#1073947

---
 fence/agents/lib/fencing.py.py | 9 ++++-----
 1 file 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"]))
-- 
1.8.3.1



           reply	other threads:[~2014-03-07 14:43 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <302229747.11643904.1394203224564.JavaMail.zimbra@redhat.com>]

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=1453301325.11644723.1394203380048.JavaMail.zimbra@redhat.com \
    --to=omular@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 NNTP newsgroup(s).