diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2011-01-22 10:52:22 -0600 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2011-01-22 10:52:22 -0600 |
commit | fbe3ffd8ecf28db72109190efefa830ed3561c22 (patch) | |
tree | a5c7d8c983ffa06a9bb597a3b0f60a3793b6991c /src/lib/Server | |
parent | dc94347e2282e8343b3cdb2dd6b85808fa4e2a1e (diff) | |
download | bcfg2-fbe3ffd8ecf28db72109190efefa830ed3561c22.tar.gz bcfg2-fbe3ffd8ecf28db72109190efefa830ed3561c22.tar.bz2 bcfg2-fbe3ffd8ecf28db72109190efefa830ed3561c22.zip |
Metadata: report multiple group definitions (Resolves Ticket #784)
Diffstat (limited to 'src/lib/Server')
-rw-r--r-- | src/lib/Server/Plugins/Metadata.py | 5 |
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')) |