summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-03 14:19:54 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-03 14:19:54 -0400
commit047006a2c404b1ebd5eb0b643a6530a99a88b5ea (patch)
tree63edfb98639ae340967c52eb87397b4a0d8fc848 /src
parentb2e860717ed5747b8d66187824a747d4794ed472 (diff)
downloadbcfg2-047006a2c404b1ebd5eb0b643a6530a99a88b5ea.tar.gz
bcfg2-047006a2c404b1ebd5eb0b643a6530a99a88b5ea.tar.bz2
bcfg2-047006a2c404b1ebd5eb0b643a6530a99a88b5ea.zip
fixed yum version support for version="any"
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/Yum.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
index 2f197443c..27523f2ab 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
@@ -429,17 +429,20 @@ class YumCollection(Collection):
def packages_to_entry(self, pkglist, entry):
def _get_entry_attrs(pkgtup):
- attrs = dict(arch=pkgtup[1],
- epoch=pkgtup[2],
- version=pkgtup[3],
- release=pkgtup[4])
- if attrs['version'] is None:
- attrs['version'] = self.setup.cfp.get("packages",
- "version",
- default="auto"),
- for k in attrs.keys()[:]:
- if attrs[k] is None:
- del attrs[k]
+ attrs = dict(version=self.setup.cfp.get("packages",
+ "version",
+ default="auto"))
+ if attrs['version'] == 'any':
+ return attrs
+
+ if pkgtup[1]:
+ attrs['arch'] = pkgtup[1]
+ if pkgtup[2]:
+ attrs['epoch'] = pkgtup[2]
+ if pkgtup[3]:
+ attrs['version'] = pkgtup[3]
+ if pkgtup[4]:
+ attrs['release'] = pkgtup[4]
return attrs
packages = dict()