From fe39aade2aa6c4203e0e9e75e5fb4d73fac9e8df Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Mon, 5 Jan 2015 08:47:40 -0800 Subject: [PATCH] Allow the version argument for the pkg state to accept the "latest" as a value. If specified then the latest version available will be installed. Per #19291 --- salt/states/pkg.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/salt/states/pkg.py b/salt/states/pkg.py index 7af195b4ec..6ddb5aa5f9 100644 --- a/salt/states/pkg.py +++ b/salt/states/pkg.py @@ -801,6 +801,9 @@ def installed( if not isinstance(version, string_types) and version is not None: version = str(version) + if version is not None and version == 'latest': + version = __salt__['pkg.latest_version'](name) + kwargs['allow_updates'] = allow_updates result = _find_install_targets(name, version, pkgs, sources, fromrepo=fromrepo,