summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2011-01-22 10:52:22 -0600
committerNarayan Desai <desai@mcs.anl.gov>2011-01-22 10:52:22 -0600
commitfbe3ffd8ecf28db72109190efefa830ed3561c22 (patch)
treea5c7d8c983ffa06a9bb597a3b0f60a3793b6991c /src/lib
parentdc94347e2282e8343b3cdb2dd6b85808fa4e2a1e (diff)
downloadbcfg2-fbe3ffd8ecf28db72109190efefa830ed3561c22.tar.gz
bcfg2-fbe3ffd8ecf28db72109190efefa830ed3561c22.tar.bz2
bcfg2-fbe3ffd8ecf28db72109190efefa830ed3561c22.zip
Metadata: report multiple group definitions (Resolves Ticket #784)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Metadata.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py
index a7c80667f..fe4d57361 100644
--- a/src/lib/Server/Plugins/Metadata.py
+++ b/src/lib/Server/Plugins/Metadata.py
@@ -397,8 +397,13 @@ class Metadata(Bcfg2.Server.Plugin.Plugin,
self.groups = {}
grouptmp = {}
self.categories = {}
+ groupseen = list()
for group in xdata.xpath('//Groups/Group') \
+ xdata.xpath('Group'):
+ if group.get('name') not in groupseen:
+ groupseen.append(group.get('name'))
+ else:
+ self.logger.error("Metadata: Group %s defined multiply" % (group.get('name')))
grouptmp[group.get('name')] = tuple([[item.get('name') for item in group.findall(spec)]
for spec in ['./Bundle', './Group']])
grouptmp[group.get('name')][1].append(group.get('name'))