Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=53fe387f…
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
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=b6a75b41…
Commit: b6a75b41f9180f3cf4d2d2632873f4c5920ce260
Parent: 849d0dba262c2111446fb5a03040b22146c35726
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Jan 27 13:49:16 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Jan 27 13:49:16 2014 +0100
fencing: Do not output duplicities in metadata
With DEPENDENCY_OPT it becomes possible that items in device_opt can occur multiple times easily as they
are added automatically (e.g. 'password' imports also 'password_script'). This lead to a situation when
eveyrything works but XML metadata contains this item multiple times and metadata can not be used properly
by cluster stack.
---
fence/agents/lib/fencing.py.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 889bb04..fd21c69 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -440,7 +440,8 @@ def usage(avail_opt):
print " " + value["help"]
def metadata(avail_opt, options, docs):
- sorted_list = [ (key, all_opt[key]) for key in avail_opt ]
+ # avail_opt has to be unique, if there are duplicities then they should be removed
+ sorted_list = [ (key, all_opt[key]) for key in list(set(avail_opt)) ]
sorted_list.sort(lambda x, y: cmp(x[1]["order"], y[1]["order"]))
print "<?xml version=\"1.0\" ?>"