From 8f106de6bed0626787cae79aa2607992f1bbacec Mon Sep 17 00:00:00 2001 From: Marek 'marx' Grac Date: Mon, 1 Feb 2016 16:07:48 +0100 Subject: [PATCH] fence_cisco_ucs: Obtain status of device from different endpoint Resolves: rhbz#1298430 --- fence/agents/cisco_ucs/fence_cisco_ucs.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py index 6288207..331f309 100644 --- a/fence/agents/cisco_ucs/fence_cisco_ucs.py +++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py @@ -17,7 +17,9 @@ BUILD_DATE="March, 2008" RE_COOKIE = re.compile("", int(options["--shell-timeout"])) + options["--plug"] + "\"/>", int(options["--shell-timeout"])) - result = RE_STATUS.search(res) + result = RE_GET_PNDN.search(res) + if result == None: + fail(EC_STATUS) + else: + pndn = result.group(1) + + res = send_command(options, "", int(options["--shell-timeout"])) + + result = RE_GET_OPERPOWER.search(res) if result == None: fail(EC_STATUS) else: status = result.group(1) - if status == "up": + if status == "on": return "on" else: return "off" -- 2.4.3