diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2020-12-11 13:43:46 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2020-12-28 12:48:59 -0800 |
commit | c7bab4d5778a91a54b3be7ed07931f92ea9a4561 (patch) | |
tree | 9952475656549f9efd2e2e0c6955573bbd181ddf | |
parent | b88ff7352f0872a3897363d68966160bdafb4190 (diff) | |
download | chef-c7bab4d5778a91a54b3be7ed07931f92ea9a4561.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) |