Gitweb:
http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=b6a75b...
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\" ?>"