diff options
Diffstat (limited to 'lib/chef/provider')
-rw-r--r-- | lib/chef/provider/package.rb | 4 | ||||
-rw-r--r-- | lib/chef/provider/package/dnf/dnf_helper.py | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb index e71bee2b0d..f96ce34fc0 100644 --- a/lib/chef/provider/package.rb +++ b/lib/chef/provider/package.rb @@ -434,6 +434,8 @@ class Chef case action when :upgrade if current_version.nil? + # with installed_version_satisfies_version_constraints there may be a package installed, but it fails the user's + # requested new_resource.version constraints logger.trace("#{new_resource} has no existing installed version. Installing install #{candidate_version}") target_version_array.push(candidate_version) elsif version_equals?(current_version, new_version) @@ -467,6 +469,8 @@ class Chef target_version_array.push(new_version) end elsif current_version.nil? + # with installed_version_satisfies_version_constraints there may be a package installed, but it fails the user's + # requested new_resource.version constraints logger.trace("#{new_resource} #{package_name} not installed, installing #{candidate_version}") target_version_array.push(candidate_version) else diff --git a/lib/chef/provider/package/dnf/dnf_helper.py b/lib/chef/provider/package/dnf/dnf_helper.py index 2860473666..1dc797a643 100644 --- a/lib/chef/provider/package/dnf/dnf_helper.py +++ b/lib/chef/provider/package/dnf/dnf_helper.py @@ -98,6 +98,9 @@ def query(command): q = q.available() if 'epoch' in command: + # We assume that any glob is "*" so just omit the filter since the dnf libraries have no + # epoch__glob filter. That means "?" wildcards in epochs will fail. The workaround is to + # not use the version filter here but to put the version with all the globs in the package name. if not dnf.util.is_glob_pattern(command['epoch']): q = q.filterm(epoch=int(command['epoch'])) if 'version' in command: |