diff options
Diffstat (limited to 'src/lib/Server/Plugins/Packages/__init__.py')
-rw-r--r-- | src/lib/Server/Plugins/Packages/__init__.py | 13 |
1 files changed, 11 insertions, 2 deletions
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: |