diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-11-01 00:08:00 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-30 01:22:51 +0100 |
commit | be0714757cbd4dc4748855e72bcec4476fd07e38 (patch) | |
tree | ae7701cd7e5021148fe8d67be4ed4ca8addfc3ab /src/lib/Server/Plugins/Packages/__init__.py | |
parent | 782b72a67360882c7637ab3be4b5e7f62e01cbe6 (diff) | |
download | bcfg2-be0714757cbd4dc4748855e72bcec4476fd07e38.tar.gz bcfg2-be0714757cbd4dc4748855e72bcec4476fd07e38.tar.bz2 bcfg2-be0714757cbd4dc4748855e72bcec4476fd07e38.zip |
Packages: add src attribute to package definition
using the src attribute, you could pin a package to a named source
Diffstat (limited to 'src/lib/Server/Plugins/Packages/__init__.py')
-rw-r--r-- | src/lib/Server/Plugins/Packages/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Packages/__init__.py b/src/lib/Server/Plugins/Packages/__init__.py index 17a3458bd..637560de5 100644 --- a/src/lib/Server/Plugins/Packages/__init__.py +++ b/src/lib/Server/Plugins/Packages/__init__.py @@ -149,11 +149,15 @@ class Packages(Bcfg2.Server.Plugin.Plugin, initial = set() # base is the set of initial packages with groups expanded base = set() + pinned_src = dict() to_remove = [] for struct in structures: for pkg in struct.xpath('//Package | //BoundPackage'): if pkg.get("name"): initial.add(pkg.get("name")) + + if pkg.get("src"): + pinned_src[pkg.get("name")] = pkg.get("src") elif pkg.get("group"): try: if pkg.get("type"): @@ -174,7 +178,7 @@ class Packages(Bcfg2.Server.Plugin.Plugin, for el in to_remove: el.getparent().remove(el) - packages, unknown = collection.complete(base) + packages, unknown = collection.complete(base, pinned_src) if unknown: self.logger.info("Packages: Got %d unknown entries" % len(unknown)) self.logger.info("Packages: %s" % list(unknown)) |