diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2013-06-13 00:50:46 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2014-02-26 13:38:15 +0100 |
commit | aaaad67f8eb441d599a16703d3a59c3e381c74c4 (patch) | |
tree | 2cf8b437aa74c835a72de256d77222a992d6a39e /src/lib/Bcfg2/Server/Plugins/Packages/__init__.py | |
parent | 12edf6186b236006963b83ac8ffe174665e097b9 (diff) | |
download | bcfg2-aaaad67f8eb441d599a16703d3a59c3e381c74c4.tar.gz bcfg2-aaaad67f8eb441d599a16703d3a59c3e381c74c4.tar.bz2 bcfg2-aaaad67f8eb441d599a16703d3a59c3e381c74c4.zip |
Plugins/Packages: ability to overwrite recommended flag per package
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/__init__.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/__init__.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py index 4b58c0fdb..84ba53840 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py @@ -396,10 +396,15 @@ class Packages(Bcfg2.Server.Plugin.Plugin, initial = set() to_remove = [] groups = [] + recommended = dict() + for struct in structures: for pkg in struct.xpath('//Package | //BoundPackage'): if pkg.get("name"): initial.update(collection.packages_from_entry(pkg)) + + if pkg.get("recommended"): + recommended[pkg.get("name")] = pkg.get("recommended") elif pkg.get("group"): groups.append((pkg.get("group"), pkg.get("type"))) @@ -433,11 +438,12 @@ class Packages(Bcfg2.Server.Plugin.Plugin, base.update(collection.get_essential()) # check for this set of packages in the package cache - pkey = hash(tuple(base)) + pkey = hash((tuple(base), tuple(recommended))) if pkey not in self.pkgcache[collection.cachekey]: self.pkgcache[collection.cachekey][pkey] = \ - collection.complete(base) + collection.complete(base, recommended) packages, unknown = self.pkgcache[collection.cachekey][pkey] + if unknown: self.logger.info("Packages: Got %d unknown entries" % len(unknown)) self.logger.info("Packages: %s" % list(unknown)) |