diff options
author | Lance Albertson <lance@osuosl.org> | 2023-04-18 12:21:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 15:21:47 -0400 |
commit | 6fdfe6ba975bd03da6b03225d7fe19f10b0f7306 (patch) | |
tree | 581cab969a90b4bf572bf68d65dcc26ff1b5e3cb /lib | |
parent | 09403f49de67b31fb1d6a8fbd4767dd0b22b9dee (diff) | |
download | chef-6fdfe6ba975bd03da6b03225d7fe19f10b0f7306.tar.gz |
zypper_package: Fix idempotency issue (#13691)
Installing the apache2-mod_wsgi-python3 package is not idempotent due to the
fact that zypper will also return the apache2-mod_wsgi package. The
resolve_available_version method, incorrectly assumes this will only return one
item, but in this case it returns four items and will pick the first package
listed.
To work around this, we should verify that the package name listed in the output
matches what we are expecting to install.
Signed-off-by: Lance Albertson <lance@osuosl.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/package/zypper.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/chef/provider/package/zypper.rb b/lib/chef/provider/package/zypper.rb index 9cd95aade7..80d6f6daeb 100644 --- a/lib/chef/provider/package/zypper.rb +++ b/lib/chef/provider/package/zypper.rb @@ -141,6 +141,7 @@ class Chef if md = line.match(/^(\S*)\s+\|\s+(\S+)\s+\|\s+(\S+)\s+\|\s+(\S+)\s+\|\s+(\S+)\s+\|\s+(.*)$/) (status, name, type, version, arch, repo) = [ md[1], md[2], md[3], md[4], md[5], md[6] ] next if version == "Version" # header + next if name != package_name # sometimes even though we request a specific version in the search string above and have match exact, we wind up # with other versions in the output, particularly getting the installed version when downgrading. |