From b4d24ddda8332a274fa9c3ea5eb72dc6807db298 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 2 Dec 2016 15:09:30 -0800 Subject: arches were legit busted, fixing add a couple tests Signed-off-by: Lamont Granquist --- lib/chef/provider/package/dnf_helper.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/chef') diff --git a/lib/chef/provider/package/dnf_helper.py b/lib/chef/provider/package/dnf_helper.py index 6295df5892..4f85dda898 100644 --- a/lib/chef/provider/package/dnf_helper.py +++ b/lib/chef/provider/package/dnf_helper.py @@ -46,8 +46,10 @@ def query(command): if 'arch' in command: q = q.filterm(arch__glob=command['arch']) - # FIXME: if the filter already selected the other arch this will be busted? - q = q.filter(arch=[ 'noarch', hawkey.detect_arch() ]) + # only apply the default arch query filter if it returns something + archq = q.filter(arch=[ 'noarch', hawkey.detect_arch() ]) + if len(archq.run()) > 0: + q = archq pkgs = dnf.query.latest_limit_pkgs(q, 1) -- cgit v1.2.1