diff --git a/SOURCES/bz1323962-1-fence_cisco_ucs-Obtain-status-from-different-attr.patch b/SOURCES/bz1323962-1-fence_cisco_ucs-Obtain-status-from-different-attr.patch new file mode 100644 index 0000000..104951c --- /dev/null +++ b/SOURCES/bz1323962-1-fence_cisco_ucs-Obtain-status-from-different-attr.patch @@ -0,0 +1,40 @@ +commit d681273ff1b6fdc9c4e314aa9c9eb28b4a252230 +Author: Marek 'marx' Grac <mgrac@redhat.com> +Date: Tue Feb 9 09:46:21 2016 +0100 + + fence_cisco_ucs: Obtain 'status' from different attribute + +diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py +index bca8087..260925e 100644 +--- a/fence/agents/cisco_ucs/fence_cisco_ucs.py ++++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py +@@ -19,7 +19,7 @@ RE_STATUS = re.compile("<lsPower .*? state=\"(.*?)\"", re.IGNORECASE) + RE_GET_DN = re.compile(" dn=\"(.*?)\"", re.IGNORECASE) + RE_GET_PNDN = re.compile(" pndn=\"(.*?)\"", re.IGNORECASE) + RE_GET_DESC = re.compile(" descr=\"(.*?)\"", re.IGNORECASE) +-RE_GET_OPERPOWER = re.compile(" operPower=\"(.*?)\"", re.IGNORECASE) ++RE_GET_PRESENCE = re.compile(" presence=\"(.*?)\"", re.IGNORECASE) + + options_global = None + +@@ -40,16 +40,16 @@ def get_power_status(conn, options): + "\" inHierarchical=\"false\" dn=\"" + pndn + + "\"/>", int(options["--shell-timeout"])) + +- result = RE_GET_OPERPOWER.search(res) ++ result = RE_GET_PRESENCE.search(res) + if result == None: + fail(EC_STATUS) + else: + status = result.group(1) + +- if status == "on": +- return "on" +- else: ++ if status in ["missing", "mismatch"]: + return "off" ++ else: ++ return "on" + + def set_power_status(conn, options): + del conn diff --git a/SOURCES/bz1323962-2-fence_cisco_ucs-Obtain-status-from-different-attr.patch b/SOURCES/bz1323962-2-fence_cisco_ucs-Obtain-status-from-different-attr.patch new file mode 100644 index 0000000..190001d --- /dev/null +++ b/SOURCES/bz1323962-2-fence_cisco_ucs-Obtain-status-from-different-attr.patch @@ -0,0 +1,52 @@ +From 9f9a6829ead6199ecb65c4f85f400a0e403c8c47 Mon Sep 17 00:00:00 2001 +From: Marek 'marx' Grac <mgrac@redhat.com> +Date: Mon, 15 Aug 2016 10:48:47 +0200 +Subject: [PATCH] fence_cisco_ucs: Improve a method to obtain status + +On Cisco UCS there are two attributes which are important for obtaining +correct power status of blade. One checks if slot is powered ON and other if +the node is pulled off the blade. +--- + fence/agents/cisco_ucs/fence_cisco_ucs.py | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py +index 648e45f..0d9609d 100644 +--- a/fence/agents/cisco_ucs/fence_cisco_ucs.py ++++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py +@@ -19,6 +19,7 @@ RE_STATUS = re.compile("<lsPower .*? state=\"(.*?)\"", re.IGNORECASE) + RE_GET_DN = re.compile(" dn=\"(.*?)\"", re.IGNORECASE) + RE_GET_PNDN = re.compile(" pndn=\"(.*?)\"", re.IGNORECASE) + RE_GET_DESC = re.compile(" descr=\"(.*?)\"", re.IGNORECASE) ++RE_GET_OPERPOWER = re.compile(" operPower=\"(.*?)\"", re.IGNORECASE) + RE_GET_PRESENCE = re.compile(" presence=\"(.*?)\"", re.IGNORECASE) + + options_global = None +@@ -50,12 +51,21 @@ def get_power_status(conn, options): + if result == None: + fail(EC_STATUS) + else: +- status = result.group(1) ++ presence_status = result.group(1) + +- if status in ["missing", "mismatch"]: ++ if presence_status in ["missing", "mismatch"]: + return "off" + else: +- return "on" ++ result = RE_GET_OPERPOWER.search(res) ++ if result == None: ++ fail(EC_STATUS) ++ else: ++ power_status = result.group(1) ++ ++ if power_status == "on": ++ return "on" ++ else: ++ return "off" + + def set_power_status(conn, options): + del conn +-- +2.4.11 + diff --git a/SPECS/fence-agents.spec b/SPECS/fence-agents.spec index 0a6e29f..2759e3d 100644 --- a/SPECS/fence-agents.spec +++ b/SPECS/fence-agents.spec @@ -16,7 +16,7 @@ Name: fence-agents Summary: Fence Agents for Red Hat Cluster Version: 4.0.11 -Release: 27%{?alphatag:.%{alphatag}}%{?dist}.7 +Release: 27%{?alphatag:.%{alphatag}}%{?dist}.9 License: GPLv2+ and LGPLv2+ Group: System Environment/Base URL: http://sourceware.org/cluster/wiki/ @@ -99,6 +99,8 @@ Patch74: bz1303698-2-fence_cisco_ucs-Add-missing-as-off.patch Patch75: bz1303698-3-fence_cisco_ucs-Update-XML-metadata.patch Patch76: bz1303698-4-fence_cisco_ucs-Update-XML-metadata.patch Patch77: bz1322702-fix-automatic-nova-evacuate.patch +Patch78: bz1323962-1-fence_cisco_ucs-Obtain-status-from-different-attr.patch +Patch79: bz1323962-2-fence_cisco_ucs-Obtain-status-from-different-attr.patch %if 0%{?rhel} %global supportedagents apc apc_snmp bladecenter brocade cisco_mds cisco_ucs compute drac5 eaton_snmp emerson eps hpblade ibmblade ifmib ilo ilo_moonshot ilo_mp ilo_ssh intelmodular ipdu ipmilan mpath kdump rhevm rsa rsb scsi vmware_soap wti @@ -202,6 +204,8 @@ BuildRequires: autoconf automake libtool %patch75 -p1 -b .bz1303698-3 %patch76 -p1 -b .bz1303698-4 %patch77 -p1 -b .bz1322702 +%patch78 -p1 -b .bz1323962 +%patch79 -p1 -b .bz1323962-2 %build ./autogen.sh @@ -769,6 +773,14 @@ The fence-agents-zvm package contains a fence agent for z/VM hypervisors %endif %changelog +* Thu Aug 25 2016 Marek Grac <mgrac@redhat.com> - 4.0.11-27.9 +- fence_cisco_ucs: Change endpoint for 'status' action + Resolves: rhbz#1323962 + +* Wed Apr 13 2016 Marek Grac <mgrac@redhat.com> - 4.0.11-27.8 +- fence_cisco_ucs: Change endpoint for 'status' action + Resolves: rhbz#1323962 + * Tue Apr 05 2016 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.0.11-27.7 - fence_compute: fix evacuation not working when instance was created by non-admin user