Blame SOURCES/bz1256908-fence_ilo-tls_negotiation.patch

44709c
commit 1fe05064d950c24b6bb180170d314915c25331ec
44709c
Author: Marek 'marx' Grac <mgrac@redhat.com>
44709c
Date:   Wed Aug 26 16:24:30 2015 +0200
44709c
44709c
    fence_ilo: If gnutls can not open connection than --tls1.0 is tried in second attempt
44709c
    
44709c
    Resolves: rhbz#1256908
44709c
44709c
diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py
44709c
index 047040b..d52b7a7 100644
44709c
--- a/fence/agents/ilo/fence_ilo.py
44709c
+++ b/fence/agents/ilo/fence_ilo.py
44709c
@@ -95,6 +95,23 @@ the iLO card through an XML stream."
44709c
 	try:
44709c
 		conn.send("\r\n")
44709c
 		conn.log_expect(options, ["</RIBCL>", "<END_RIBCL/>"], int(options["--login-timeout"]))
44709c
+	except pexpect.TIMEOUT:
44709c
+		fail(EC_LOGIN_DENIED)
44709c
+	except pexpect.EOF:
44709c
+		if "--tls1.0" in options:
44709c
+			fail(EC_LOGIN_DENIED)
44709c
+		options["--tls1.0"] = "1"
44709c
+		conn.close()
44709c
+		conn = fence_login(options)
44709c
+		try:
44709c
+			conn.send("\r\n")
44709c
+			conn.log_expect(options, ["</RIBCL>", "<END_RIBCL/>"], int(options["--login-timeout"]))
44709c
+		except pexpect.TIMEOUT:
44709c
+			fail(EC_LOGIN_DENIED)
44709c
+		except pexpect.EOF:
44709c
+			fail(EC_LOGIN_DENIED)
44709c
+
44709c
+	try:
44709c
 		version = re.compile("
44709c
 		if not options.has_key("--ribcl-version"):
44709c
 			options["--ribcl-version"] = float(version)