Blame SOURCES/bz1022536-2-fence_wti-named_groups.patch

182b9e
From 53fe387f00278e769e00ec10b28e2cb6ff52c8b1 Mon Sep 17 00:00:00 2001
182b9e
From: Marek 'marx' Grac <mgrac@redhat.com>
182b9e
Date: Wed, 29 Jan 2014 15:29:21 +0100
182b9e
Subject: [PATCH] fence_wti: Add support for firmware v1.40 (on MPC device)
182b9e
182b9e
Previously, named groups were tested only on firmware v1.43 (on NPS device).
182b9e
---
182b9e
 fence/agents/wti/fence_wti.py |    7 ++++---
182b9e
 1 files changed, 4 insertions(+), 3 deletions(-)
182b9e
182b9e
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
182b9e
index 34967e1..c9c5237 100644
182b9e
--- a/fence/agents/wti/fence_wti.py
182b9e
+++ b/fence/agents/wti/fence_wti.py
182b9e
@@ -96,12 +96,13 @@ def get_plug_group_status(conn, options):
182b9e
 		if (line.find("|") >= 0 and line.lstrip().startswith("GROUP NAME") == False):
182b9e
 			plug_line = [x.strip().lower() for x in line.split("|")]
182b9e
 			if ["list", "monitor"].count(options["--action"]) == 0 and options["--plug"].lower() == plug_line[name_index]:
182b9e
-				line_index += 1
182b9e
 				plug_status = []
182b9e
 				while line_index < len(lines) and line_index >= 0:
182b9e
 					plug_line = [x.strip().lower() for x in lines[line_index].split("|")]
182b9e
-					if len(plug_line[plug_index]) > 0 and len(plug_line[name_index]) == 0:
182b9e
-						plug_status.append(plug_line[status_index])
182b9e
+					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]):
182b9e
+						## Firmware 1.43 does not have a valid value of plug on first line as only name is defined on that line
182b9e
+						if not "---" in plug_line[status_index]:
182b9e
+							plug_status.append(plug_line[status_index])
182b9e
 						line_index += 1
182b9e
 					else:
182b9e
 						line_index = -1
182b9e
-- 
182b9e
1.7.7.6
182b9e