Blame SOURCES/bz1490475-fence_ilo_ssh-fix-hard-reset.patch

035a21
From d41299f89086277d291695f0c16538b2a0f54fd9 Mon Sep 17 00:00:00 2001
035a21
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
035a21
Date: Tue, 12 Sep 2017 16:00:46 +0200
035a21
Subject: [PATCH 1/3] fence_ilo_ssh: fix hard reset
035a21
035a21
---
035a21
 fence/agents/ilo_ssh/fence_ilo_ssh.py | 2 +-
035a21
 1 file changed, 1 insertion(+), 1 deletion(-)
035a21
035a21
diff --git a/fence/agents/ilo_ssh/fence_ilo_ssh.py b/fence/agents/ilo_ssh/fence_ilo_ssh.py
035a21
index b0366157..fc44f98b 100644
035a21
--- a/fence/agents/ilo_ssh/fence_ilo_ssh.py
035a21
+++ b/fence/agents/ilo_ssh/fence_ilo_ssh.py
035a21
@@ -29,7 +29,7 @@ def set_power_status(conn, options):
035a21
 	return
035a21
 
035a21
 def reboot_cycle(conn, options):
035a21
-	conn.send_eol("reset hard /system1")
035a21
+	conn.send_eol("reset /system1 hard")
035a21
 	conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
035a21
 	return
035a21
 
035a21
035a21
From 8a9252657455a850ae2389ad6532d01dd3d8c5a4 Mon Sep 17 00:00:00 2001
035a21
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
035a21
Date: Wed, 25 Oct 2017 11:21:06 +0200
035a21
Subject: [PATCH 2/3] fence_ilo_ssh: return True in reboot_cycle()
035a21
035a21
---
035a21
 fence/agents/ilo_ssh/fence_ilo_ssh.py | 2 +-
035a21
 1 file changed, 1 insertion(+), 1 deletion(-)
035a21
035a21
diff --git a/fence/agents/ilo_ssh/fence_ilo_ssh.py b/fence/agents/ilo_ssh/fence_ilo_ssh.py
035a21
index fc44f98b..3445f846 100644
035a21
--- a/fence/agents/ilo_ssh/fence_ilo_ssh.py
035a21
+++ b/fence/agents/ilo_ssh/fence_ilo_ssh.py
035a21
@@ -31,7 +31,7 @@ def set_power_status(conn, options):
035a21
 def reboot_cycle(conn, options):
035a21
 	conn.send_eol("reset /system1 hard")
035a21
 	conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
035a21
-	return
035a21
+	return True
035a21
 
035a21
 def main():
035a21
 	device_opt = ["ipaddr", "login", "passwd", "secure", "cmd_prompt", "method", "telnet"]
035a21
035a21
From 70712afaa1f37be09cc793a84bfdf5c2e0d7c07b Mon Sep 17 00:00:00 2001
035a21
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
035a21
Date: Thu, 26 Oct 2017 12:22:18 +0200
035a21
Subject: [PATCH 3/3] fence_ilo_ssh: warn if power is OFF in reboot_cycle()
035a21
035a21
---
035a21
 fence/agents/ilo_ssh/fence_ilo_ssh.py | 5 +++++
035a21
 1 file changed, 5 insertions(+)
035a21
035a21
diff --git a/fence/agents/ilo_ssh/fence_ilo_ssh.py b/fence/agents/ilo_ssh/fence_ilo_ssh.py
035a21
index 3445f846..f2c1f98d 100644
035a21
--- a/fence/agents/ilo_ssh/fence_ilo_ssh.py
035a21
+++ b/fence/agents/ilo_ssh/fence_ilo_ssh.py
035a21
@@ -2,6 +2,7 @@
035a21
 
035a21
 import sys, re
035a21
 import atexit
035a21
+import logging
035a21
 sys.path.append("@FENCEAGENTSLIBDIR@")
035a21
 from fencing import *
035a21
 
035a21
@@ -31,6 +32,10 @@ def set_power_status(conn, options):
035a21
 def reboot_cycle(conn, options):
035a21
 	conn.send_eol("reset /system1 hard")
035a21
 	conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
035a21
+
035a21
+	if get_power_status(conn, options) == "off":
035a21
+		logging.error("Timed out waiting to power ON\n")
035a21
+
035a21
 	return True
035a21
 
035a21
 def main():