Blob Blame History Raw
commit 1fe05064d950c24b6bb180170d314915c25331ec
Author: Marek 'marx' Grac <mgrac@redhat.com>
Date:   Wed Aug 26 16:24:30 2015 +0200

    fence_ilo: If gnutls can not open connection than --tls1.0 is tried in second attempt
    
    Resolves: rhbz#1256908

diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py
index 047040b..d52b7a7 100644
--- a/fence/agents/ilo/fence_ilo.py
+++ b/fence/agents/ilo/fence_ilo.py
@@ -95,6 +95,23 @@ the iLO card through an XML stream."
 	try:
 		conn.send("<?xml version=\"1.0\"?>\r\n")
 		conn.log_expect(options, ["</RIBCL>", "<END_RIBCL/>"], int(options["--login-timeout"]))
+	except pexpect.TIMEOUT:
+		fail(EC_LOGIN_DENIED)
+	except pexpect.EOF:
+		if "--tls1.0" in options:
+			fail(EC_LOGIN_DENIED)
+		options["--tls1.0"] = "1"
+		conn.close()
+		conn = fence_login(options)
+		try:
+			conn.send("<?xml version=\"1.0\"?>\r\n")
+			conn.log_expect(options, ["</RIBCL>", "<END_RIBCL/>"], int(options["--login-timeout"]))
+		except pexpect.TIMEOUT:
+			fail(EC_LOGIN_DENIED)
+		except pexpect.EOF:
+			fail(EC_LOGIN_DENIED)
+
+	try:
 		version = re.compile("<RIBCL VERSION=\"(.*?)\"", re.IGNORECASE).search(conn.before).group(1)
 		if not options.has_key("--ribcl-version"):
 			options["--ribcl-version"] = float(version)