summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-06-11 10:10:41 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2018-10-18 16:12:20 +0200
commitab420dd0188b790befad4eacec09c23801042863 (patch)
treed84cdc24c6b2c966810e4331daab5c59b3008eba /src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
parentab5a2a40c1318459a28dcce3293f3c3732107715 (diff)
downloadbcfg2-ab420dd0188b790befad4eacec09c23801042863.tar.gz
bcfg2-ab420dd0188b790befad4eacec09c23801042863.tar.bz2
bcfg2-ab420dd0188b790befad4eacec09c23801042863.zip
Plugins/PkgVars: new plugin to set various vars per package
This plugins allows the setting of varius flags per package. It should be used f.e. to specify pinnings for debian packages or use flags and keywords for gentoo packages (needs to be implemented by future Portage plugin).
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/__init__.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
index 23ccd7b8e..59a061868 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
@@ -315,6 +315,10 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
groups = []
recommended = dict()
+ pinned_src = dict()
+ if hasattr(metadata, 'PkgVars'):
+ pinned_src = metadata.PkgVars['pin']
+
for struct in structures:
for pkg in struct.xpath('//Package | //BoundPackage'):
if pkg.get("name"):
@@ -356,11 +360,11 @@ 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), tuple(pinned_src)))
pcache = Bcfg2.Server.Cache.Cache("Packages", "pkg_sets",
collection.cachekey)
if pkey not in pcache:
- pcache[pkey] = collection.complete(base, recommended)
+ pcache[pkey] = collection.complete(base, recommended, pinned_src)
packages, unknown = pcache[pkey]
if unknown:
self.logger.info("Packages: Got %d unknown entries" % len(unknown))