summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/server/plugins/generators/packages.txt2
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/__init__.py8
2 files changed, 8 insertions, 2 deletions
diff --git a/doc/server/plugins/generators/packages.txt b/doc/server/plugins/generators/packages.txt
index 276b73093..e4035053a 100644
--- a/doc/server/plugins/generators/packages.txt
+++ b/doc/server/plugins/generators/packages.txt
@@ -662,6 +662,8 @@ It understands the following directives:
* ``gpg_keypath``: The path on the client RPM GPG keys will be copied
to before they are imported on the client. Default is
"/etc/pki/rpm-gpg".
+* ``version``: Set the version attribute used when binding
+ Packages. Default is ``auto``.
* ``import_gpg_keys``: The RPM release of an RPM GPG key cannot be
reliably and automatically determined without importing the key into
the server's key chain. If ``import_gpg_keys`` is "false" (the
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
index da5832e90..0d5e7d50f 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
@@ -88,6 +88,9 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
if entry.tag == 'Package':
collection = self._get_collection(metadata)
entry.set('version', 'auto')
+ entry.set('version', self.config.get("global",
+ "version",
+ default="auto"))
entry.set('type', collection.ptype)
elif entry.tag == 'Path':
if (entry.get("name") == self.config.get("global", "yum_config",
@@ -178,8 +181,9 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
newpkgs.sort()
for pkg in newpkgs:
lxml.etree.SubElement(independent, 'BoundPackage', name=pkg,
- version='auto', type=collection.ptype,
- origin='Packages')
+ version=self.config.get("global", "version",
+ default="auto"),
+ type=collection.ptype, origin='Packages')
def Refresh(self):
'''Packages.Refresh() => True|False\nReload configuration