cluster: RHEL58 - fence_rhevm: Incorrect status detected when VM is not in up/down

Marek GrĂ¡c marx at fedoraproject.org
Mon Feb 20 15:00:58 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=287969c7a60d31e54613925144abf2534255b691
Commit:        287969c7a60d31e54613925144abf2534255b691
Parent:        d2a549268e462cc884622494b21325279087d813
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Mon Jan 30 16:50:30 2012 +0100
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Mon Feb 20 14:58:19 2012 +0100

fence_rhevm: Incorrect status detected when VM is not in up/down

For fencing purposes we have to focus on getting OFF status
when machine is really 100% down, conditions for ON status are much simplier
(as fact that machine is has power does not mean that it works). This patch
specify condition for OFF status - in fact only 'Down' is accepted now

Resolves: rhbz#786485
---
 fence/agents/rhevm/fence_rhevm.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fence/agents/rhevm/fence_rhevm.py b/fence/agents/rhevm/fence_rhevm.py
index e420455..f7854f2 100755
--- a/fence/agents/rhevm/fence_rhevm.py
+++ b/fence/agents/rhevm/fence_rhevm.py
@@ -40,10 +40,10 @@ def get_power_status(conn, options):
 	else:
 		status = result.group(1)
 
-	if (status == "up"):
-		return "on"
-	else:
+	if (status.lower() == "down"):
 		return "off"
+	else:
+		return "on"
 
 def set_power_status(conn, options):
 	action = {


More information about the cluster-commits mailing list