summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2011-10-12 15:54:00 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2011-10-12 15:54:00 -0400
commit5f878bfc6c6c33ffaea193502f205f86a893694f (patch)
tree2bd42c3f70969d3af338559d036fd6269acbaf78
parentbeed44ac11bbf70449c080262f98fb3ecb951c62 (diff)
downloadbcfg2-5f878bfc6c6c33ffaea193502f205f86a893694f.tar.gz
bcfg2-5f878bfc6c6c33ffaea193502f205f86a893694f.tar.bz2
bcfg2-5f878bfc6c6c33ffaea193502f205f86a893694f.zip
fixed inclusion of group packages
fixed loading of sources at server startup
-rw-r--r--src/lib/Server/Plugins/Packages/Collection.py3
-rw-r--r--src/lib/Server/Plugins/Packages/__init__.py13
2 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/Server/Plugins/Packages/Collection.py b/src/lib/Server/Plugins/Packages/Collection.py
index aed85fe77..ab87257e1 100644
--- a/src/lib/Server/Plugins/Packages/Collection.py
+++ b/src/lib/Server/Plugins/Packages/Collection.py
@@ -124,8 +124,7 @@ class Collection(object):
def setup_data(self, force_update=False):
""" do any collection-level data setup tasks """
- for source in self.sources:
- source.setup_data(force_update)
+ pass
def complete(self, packagelist):
'''Build the transitive closure of all package dependencies
diff --git a/src/lib/Server/Plugins/Packages/__init__.py b/src/lib/Server/Plugins/Packages/__init__.py
index 1132543f1..4fe785f40 100644
--- a/src/lib/Server/Plugins/Packages/__init__.py
+++ b/src/lib/Server/Plugins/Packages/__init__.py
@@ -126,22 +126,27 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
if collection is None:
collection = Collection.factory(metadata, self.sources, self.data)
+ # initial is the set of packages that are explicitly specified
+ # in the configuration
initial = set()
+ # base is the set of initial packages with groups expanded
+ base = set()
to_remove = []
for struct in structures:
for pkg in struct.xpath('//Package | //BoundPackage'):
if pkg.get("name"):
initial.add(pkg.get("name"))
elif pkg.get("group"):
- initial.update(collection.get_group(pkg.get("group")))
+ base.update(collection.get_group(pkg.get("group")))
to_remove.append(pkg)
else:
self.logger.error("Malformed Package: %s" %
lxml.etree.tostring(pkg))
+ base.update(initial)
for el in to_remove:
el.getparent().remove(el)
- packages, unknown = collection.complete(initial)
+ packages, unknown = collection.complete(base)
if unknown:
self.logger.info("Got %d unknown entries" % len(unknown))
self.logger.info(list(unknown))
@@ -189,6 +194,10 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
Collection.clear_cache()
+ for source in self.sources:
+ if not self.disableMetaData:
+ source.setup_data(force_update)
+
for cfile in glob.glob(os.path.join(self.cachepath, "cache-*")):
if cfile not in cachefiles:
try: