Blob Blame History Raw
From d41299f89086277d291695f0c16538b2a0f54fd9 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Tue, 12 Sep 2017 16:00:46 +0200
Subject: [PATCH 1/3] fence_ilo_ssh: fix hard reset

---
 fence/agents/ilo_ssh/fence_ilo_ssh.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fence/agents/ilo_ssh/fence_ilo_ssh.py b/fence/agents/ilo_ssh/fence_ilo_ssh.py
index b0366157..fc44f98b 100644
--- a/fence/agents/ilo_ssh/fence_ilo_ssh.py
+++ b/fence/agents/ilo_ssh/fence_ilo_ssh.py
@@ -29,7 +29,7 @@ def set_power_status(conn, options):
 	return
 
 def reboot_cycle(conn, options):
-	conn.send_eol("reset hard /system1")
+	conn.send_eol("reset /system1 hard")
 	conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
 	return
 

From 8a9252657455a850ae2389ad6532d01dd3d8c5a4 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Wed, 25 Oct 2017 11:21:06 +0200
Subject: [PATCH 2/3] fence_ilo_ssh: return True in reboot_cycle()

---
 fence/agents/ilo_ssh/fence_ilo_ssh.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fence/agents/ilo_ssh/fence_ilo_ssh.py b/fence/agents/ilo_ssh/fence_ilo_ssh.py
index fc44f98b..3445f846 100644
--- a/fence/agents/ilo_ssh/fence_ilo_ssh.py
+++ b/fence/agents/ilo_ssh/fence_ilo_ssh.py
@@ -31,7 +31,7 @@ def set_power_status(conn, options):
 def reboot_cycle(conn, options):
 	conn.send_eol("reset /system1 hard")
 	conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
-	return
+	return True
 
 def main():
 	device_opt = ["ipaddr", "login", "passwd", "secure", "cmd_prompt", "method", "telnet"]

From 70712afaa1f37be09cc793a84bfdf5c2e0d7c07b Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Thu, 26 Oct 2017 12:22:18 +0200
Subject: [PATCH 3/3] fence_ilo_ssh: warn if power is OFF in reboot_cycle()

---
 fence/agents/ilo_ssh/fence_ilo_ssh.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fence/agents/ilo_ssh/fence_ilo_ssh.py b/fence/agents/ilo_ssh/fence_ilo_ssh.py
index 3445f846..f2c1f98d 100644
--- a/fence/agents/ilo_ssh/fence_ilo_ssh.py
+++ b/fence/agents/ilo_ssh/fence_ilo_ssh.py
@@ -2,6 +2,7 @@
 
 import sys, re
 import atexit
+import logging
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
 
@@ -31,6 +32,10 @@ def set_power_status(conn, options):
 def reboot_cycle(conn, options):
 	conn.send_eol("reset /system1 hard")
 	conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+
+	if get_power_status(conn, options) == "off":
+		logging.error("Timed out waiting to power ON\n")
+
 	return True
 
 def main():