Gitweb:
http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=53fe38...
Commit: 53fe387f00278e769e00ec10b28e2cb6ff52c8b1
Parent: b6a75b41f9180f3cf4d2d2632873f4c5920ce260
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Jan 29 15:29:21 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Jan 29 15:29:21 2014 +0100
fence_wti: Add support for firmware v1.40 (on MPC device)
Previously, named groups were tested only on firmware v1.43 (on NPS device).
---
fence/agents/wti/fence_wti.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index 34967e1..c9c5237 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -96,12 +96,13 @@ def get_plug_group_status(conn, options):
if (line.find("|") >= 0 and line.lstrip().startswith("GROUP
NAME") == False):
plug_line = [x.strip().lower() for x in line.split("|")]
if ["list", "monitor"].count(options["--action"]) == 0
and options["--plug"].lower() == plug_line[name_index]:
- line_index += 1
plug_status = []
while line_index < len(lines) and line_index >= 0:
plug_line = [x.strip().lower() for x in lines[line_index].split("|")]
- if len(plug_line[plug_index]) > 0 and len(plug_line[name_index]) == 0:
- plug_status.append(plug_line[status_index])
+ if len(plug_line) >= max(name_index, status_index) and len(plug_line[plug_index])
> 0 and (len(plug_line[name_index]) == 0 or options["--plug"].lower() ==
plug_line[name_index]):
+ ## Firmware 1.43 does not have a valid value of plug on first line as only name is
defined on that line
+ if not "---" in plug_line[status_index]:
+ plug_status.append(plug_line[status_index])
line_index += 1
else:
line_index = -1