Blame SOURCES/bz1256908-fence_ilo-tls_negotiation.patch

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