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

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