summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-04-02 16:05:05 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-04-02 16:05:05 +0000
commite9b7d2cf3dfb9ca23f10df50eac4b8f299656c3e (patch)
tree64fe799fd4cb6ba860f19541227406e4d8390469 /src/lib
parent3eac976378f28ff86ffe5a6c9cdcbc9acf000b6d (diff)
downloadbcfg2-e9b7d2cf3dfb9ca23f10df50eac4b8f299656c3e.tar.gz
bcfg2-e9b7d2cf3dfb9ca23f10df50eac4b8f299656c3e.tar.bz2
bcfg2-e9b7d2cf3dfb9ca23f10df50eac4b8f299656c3e.zip
Remove hardcoded group names from plugin body, instead, auto-activate based on active sources
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5149 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Packages.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py
index 70dfd78c9..7ed7d3831 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -294,6 +294,7 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
Bcfg2.Server.Plugin.StructureValidator.__init__(self)
Bcfg2.Server.Plugin.Generator.__init__(self)
cachepath = self.data + '/cache'
+ self.sentinals = set()
if not os.path.exists(cachepath):
# create cache directory if needed
os.mkdir(cachepath)
@@ -310,12 +311,13 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
self.logger.info("File read failed; updating sources", exc_info=1)
source.update()
source.read_files()
+ self.sentinals.update(source.basegroups)
def get_matching_sources(self, meta):
return [s for s in self.sources if s.applies(meta)]
def HandlesEntry(self, entry, metadata):
- if [x for x in metadata.groups if x in ['debian', 'ubuntu', 'redhat']] \
+ if [x for x in metadata.groups if x in self.sentinals] \
and entry.tag == 'Package':
return True
return False