Blame SOURCES/bz1073947-ssh_login_failed.patch

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