diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2011-10-11 16:59:05 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2011-10-12 10:23:46 -0400 |
commit | 86452547586c80eb8f6c433c9acc14f4de451e15 (patch) | |
tree | 9a97856bb8a6640d02189f6495ae455ee594cad6 /src/lib/Server | |
parent | 2f28cf4027f82e15180d5e022fda55699e0f0d61 (diff) | |
download | bcfg2-86452547586c80eb8f6c433c9acc14f4de451e15.tar.gz bcfg2-86452547586c80eb8f6c433c9acc14f4de451e15.tar.bz2 bcfg2-86452547586c80eb8f6c433c9acc14f4de451e15.zip |
only cache packages from a package set, not unknowns
Diffstat (limited to 'src/lib/Server')
-rw-r--r-- | src/lib/Server/Plugins/Packages/Yum.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/Server/Plugins/Packages/Yum.py b/src/lib/Server/Plugins/Packages/Yum.py index fa0dc527e..6f108b8bb 100644 --- a/src/lib/Server/Plugins/Packages/Yum.py +++ b/src/lib/Server/Plugins/Packages/Yum.py @@ -574,11 +574,11 @@ class YumCollection(Collection): cachekey = cPickle.dumps(sorted(packagelist)) try: - return self.pkgset_cache[cachekey] - except KeyError: pass + packages = self.pkgset_cache[cachekey] + except KeyError: + packages = set() - packages = set() - pkgs = set(packagelist) + pkgs = set(packagelist).difference(packages) requires = set() satisfied = set() unknown = set() @@ -667,7 +667,9 @@ class YumCollection(Collection): self.filter_unknown(unknown) unknown = [self.get_package_name(p) for p in unknown] - self.pkgset_cache[cachekey] = (packages, unknown) + # we do not cache unknown packages, since those are likely to + # be fixed + self.pkgset_cache[cachekey] = packages return packages, unknown |