summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Packages
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-02-22 09:26:51 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-02-22 09:26:57 -0500
commit1df2b8ccdb0db12087b7c33fd20fb6e50fb8238e (patch)
treeaa40c6ce3b2c9990f29475e7d9579f3f8aa75c99 /src/lib/Bcfg2/Server/Plugins/Packages
parent650b743b1eab70e9a745e1ea530aa0e217c7c8df (diff)
downloadbcfg2-1df2b8ccdb0db12087b7c33fd20fb6e50fb8238e.tar.gz
bcfg2-1df2b8ccdb0db12087b7c33fd20fb6e50fb8238e.tar.bz2
bcfg2-1df2b8ccdb0db12087b7c33fd20fb6e50fb8238e.zip
Packages: fixed overzealous deduplication of packages that removed essential and group packages
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/__init__.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
index f112c65cd..94548f4d8 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
@@ -314,16 +314,13 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
if collection is None:
collection = self.get_collection(metadata)
- # base is the set of initial packages -- explicitly
- # given in the specification, from expanded package groups,
- # and essential to the distribution
- base = set()
+ initial = set()
to_remove = []
groups = []
for struct in structures:
for pkg in struct.xpath('//Package | //BoundPackage'):
if pkg.get("name"):
- base.update(collection.packages_from_entry(pkg))
+ initial.update(collection.packages_from_entry(pkg))
elif pkg.get("group"):
groups.append((pkg.get("group"),
pkg.get("type")))
@@ -335,6 +332,11 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
pkg,
xml_declaration=False).decode('UTF-8'))
+ # base is the set of initial packages explicitly given in the
+ # specification, packages from expanded package groups, and
+ # packages essential to the distribution
+ base = set(initial)
+
# remove package groups
for el in to_remove:
el.getparent().remove(el)
@@ -350,7 +352,7 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
if unknown:
self.logger.info("Packages: Got %d unknown entries" % len(unknown))
self.logger.info("Packages: %s" % list(unknown))
- newpkgs = collection.get_new_packages(base, packages)
+ newpkgs = collection.get_new_packages(initial, packages)
self.debug_log("Packages: %d base, %d complete, %d new" %
(len(base), len(packages), len(newpkgs)))
newpkgs.sort()