From 53fe387f00278e769e00ec10b28e2cb6ff52c8b1 Mon Sep 17 00:00:00 2001 From: Marek 'marx' Grac Date: Wed, 29 Jan 2014 15:29:21 +0100 Subject: [PATCH] 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 -- 1.7.7.6