Blame SOURCES/bz1298430-1-fence_cisco_ucs-Obtain-status-from-different-attr.patch

c07789
commit d681273ff1b6fdc9c4e314aa9c9eb28b4a252230
c07789
Author: Marek 'marx' Grac <mgrac@redhat.com>
c07789
Date:   Tue Feb 9 09:46:21 2016 +0100
c07789
c07789
    fence_cisco_ucs: Obtain 'status' from different attribute
c07789
c07789
diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py
c07789
index bca8087..260925e 100644
c07789
--- a/fence/agents/cisco_ucs/fence_cisco_ucs.py
c07789
+++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py
c07789
@@ -19,7 +19,7 @@ RE_STATUS = re.compile("
c07789
 RE_GET_DN = re.compile(" dn=\"(.*?)\"", re.IGNORECASE)
c07789
 RE_GET_PNDN = re.compile(" pndn=\"(.*?)\"", re.IGNORECASE)
c07789
 RE_GET_DESC = re.compile(" descr=\"(.*?)\"", re.IGNORECASE)
c07789
-RE_GET_OPERPOWER = re.compile(" operPower=\"(.*?)\"", re.IGNORECASE)
c07789
+RE_GET_PRESENCE = re.compile(" presence=\"(.*?)\"", re.IGNORECASE)
c07789
 
c07789
 options_global = None
c07789
 
c07789
@@ -40,16 +40,16 @@ def get_power_status(conn, options):
c07789
 			"\" inHierarchical=\"false\" dn=\"" + pndn +
c07789
 			"\"/>", int(options["--shell-timeout"]))
c07789
 
c07789
-	result = RE_GET_OPERPOWER.search(res)
c07789
+	result = RE_GET_PRESENCE.search(res)
c07789
 	if result == None:
c07789
 		fail(EC_STATUS)
c07789
 	else:
c07789
 		status = result.group(1)
c07789
 
c07789
-	if status == "on":
c07789
-		return "on"
c07789
-	else:
c07789
+	if status in ["missing", "mismatch"]:
c07789
 		return "off"
c07789
+	else:
c07789
+		return "on"
c07789
 
c07789
 def set_power_status(conn, options):
c07789
 	del conn