summaryrefslogtreecommitdiffstats
path: root/src/lib/Server
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-08-27 18:59:20 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-08-27 18:59:20 +0000
commit4d23a9ea84291522dcd18dd996ae4ba03eeb6a84 (patch)
treeab795586e177847b1d6229be333d6ca3f3f4ba4f /src/lib/Server
parent6ca4082a56e4b950c6f26d986595ab8eb934f9c4 (diff)
downloadbcfg2-4d23a9ea84291522dcd18dd996ae4ba03eeb6a84.tar.gz
bcfg2-4d23a9ea84291522dcd18dd996ae4ba03eeb6a84.tar.bz2
bcfg2-4d23a9ea84291522dcd18dd996ae4ba03eeb6a84.zip
Log category-based group membership suppression (Resolves Ticket #595)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4896 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server')
-rw-r--r--src/lib/Server/Plugins/Metadata.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py
index 328ccb9d2..10ee7c853 100644
--- a/src/lib/Server/Plugins/Metadata.py
+++ b/src/lib/Server/Plugins/Metadata.py
@@ -275,6 +275,7 @@ class Metadata(Bcfg2.Server.Plugin.MetadataPlugin,
# self.groups[group] => (bundles, groups, categories)
self.groups[group] = ([], [], {})
tocheck = [group]
+ group_cat = self.groups[group][2]
while tocheck:
now = tocheck.pop()
if now not in self.groups[group][1]:
@@ -282,11 +283,17 @@ class Metadata(Bcfg2.Server.Plugin.MetadataPlugin,
if grouptmp.has_key(now):
(bundles, groups) = grouptmp[now]
for ggg in [ggg for ggg in groups if ggg not in self.groups[group][1]]:
- if not self.categories.has_key(ggg) or not self.groups[group][2].has_key(self.categories[ggg]):
+ if ggg not in self.categories or \
+ self.categories[ggg] not in self.groups[group][2]:
self.groups[group][1].append(ggg)
tocheck.append(ggg)
- if self.categories.has_key(ggg):
- self.groups[group][2][self.categories[ggg]] = ggg
+ if self.categories.has_key(ggg):
+ group_cat[self.categories[ggg]] = ggg
+ elif ggg in self.categories:
+ self.logger.info("Group %s: %s cat-suppressed %s" % \
+ (group,
+ group_cat[self.categories[ggg]],
+ ggg))
[self.groups[group][0].append(bund) for bund in bundles
if bund not in self.groups[group][0]]
self.states[dest] = True