Skip to contentSkip to conversation

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

PATCH New Marek 'marx' Grac 2 participants 2 messages Jan 30, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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#769681

---
 fence/agents/rhevm/fence_rhevm.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
fence/agents/rhevm/fence_rhevm.py +3 -3
index 65a7395..3578b5f 100644
@@ -41,10 +41,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 = {
Signature · 1 line
1.7.4.4
#1 lore raw

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

Quoted 18 lines · Marek 'marx' Grac

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#769681

---
  fence/agents/rhevm/fence_rhevm.py |    6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)
fence/agents/rhevm/fence_rhevm.py +0 -0
index 65a7395..3578b5f 100644
@@ -41,10 +41,10 @@ def get_power_status(conn, options):
  	else:
  		status = result.group(1)
 

fence/agents/rhevm/fence_rhevm.py def get_power_status(conn, options): · line 50

Quoted 10 lines
fence/agents/rhevm/fence_rhevm.py +3 -3
-	if (status == "up"):
-		return "on"
-	else:
+	if (status.lower() == "down"):
  		return "off"
+	else:
+		return "on"
 
  def set_power_status(conn, options):
  	action = {

This looks correct based on the bugzilla.

-- Lon