summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-12-15 19:57:32 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-12-15 19:57:32 -0800
commit3ebeb119b3381f5ad9f3bcf22cec3571ac731fa1 (patch)
tree9846a775f2db3814822c7e983db1855fd7924a92
parent4c87730bd6f35cb969a2b177c7e85beb9e9b6030 (diff)
downloadchef-3ebeb119b3381f5ad9f3bcf22cec3571ac731fa1.tar.gz
fix mysql-should-install-mariadb bug
picks the correct highest version off of a list if we have more than one pkg in the list at this point. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/provider/package/dnf/dnf_helper.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/provider/package/dnf/dnf_helper.py b/lib/chef/provider/package/dnf/dnf_helper.py
index 19262c2ec8..bd99b3c3b5 100644
--- a/lib/chef/provider/package/dnf/dnf_helper.py
+++ b/lib/chef/provider/package/dnf/dnf_helper.py
@@ -58,7 +58,8 @@ def query(command):
if not pkgs:
sys.stdout.write('{} nil nil\n'.format(command['provides'].split().pop(0)))
else:
- pkg = pkgs.pop(0)
+ pkgs.sort
+ pkg = pkgs.pop()
sys.stdout.write('{} {}:{}-{} {}\n'.format(pkg.name, pkg.epoch, pkg.version, pkg.release, pkg.arch))
# the design of this helper is that it should try to be 'brittle' and fail hard and exit in order