diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2020-12-11 13:43:46 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2021-01-04 17:17:52 -0800 |
commit | 21825b3e21d5e8d8c7579f88516c0740a17ab506 (patch) | |
tree | c1f0c7914cafeadcabb954706d06d2a87f46315c | |
parent | 71d0091a6c757db267cdd6738be0ca265dc0c4d0 (diff) | |
download | chef-21825b3e21d5e8d8c7579f88516c0740a17ab506.tar.gz |
comments and spellcheck
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | lib/chef/provider/package.rb | 4 | ||||
-rw-r--r-- | lib/chef/provider/package/dnf/dnf_helper.py | 3 | ||||
-rw-r--r-- | spec/functional/resource/dnf_package_spec.rb | 8 |
3 files changed, 11 insertions, 4 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: diff --git a/spec/functional/resource/dnf_package_spec.rb b/spec/functional/resource/dnf_package_spec.rb index cd107c5843..e0a69da4f9 100644 --- a/spec/functional/resource/dnf_package_spec.rb +++ b/spec/functional/resource/dnf_package_spec.rb @@ -931,7 +931,7 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do expect(dnf_package.updated_by_last_action?).to be false end - it "with a full version pin in the name it downgrdes the package" do + it "with a full version pin in the name it downgrades the package" do preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm") dnf_package.package_name("chef_rpm") dnf_package.version("1.2-1") @@ -953,7 +953,7 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do expect(dnf_package.updated_by_last_action?).to be false end - it "with a partial (no release) version pin in the name it downgrdes the package" do + it "with a partial (no release) version pin in the name it downgrades the package" do preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm") dnf_package.package_name("chef_rpm") dnf_package.version("1.2") @@ -974,7 +974,7 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do expect(dnf_package.updated_by_last_action?).to be false end - it "with a full version pin in the name it downgrdes the package" do + it "with a full version pin in the name it downgrades the package" do preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm") dnf_package.package_name("chef_rpm-1.2-1") dnf_package.run_action(:upgrade) @@ -994,7 +994,7 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do expect(dnf_package.updated_by_last_action?).to be false end - it "with a partial (no release) version pin in the name it downgrdes the package" do + it "with a partial (no release) version pin in the name it downgrades the package" do preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm") dnf_package.package_name("chef_rpm-1.2") dnf_package.run_action(:upgrade) |