salt.modules.zypperpkg.install does return sufficient message for error reasons #56016
Labels
Bug
broken, incorrect, or confusing behavior
severity-low
4th level, cosemtic problems, work around exists
Milestone
Description of Issue
The error information for installing a RPM package through zypper is not complete, which leads to an incomplete salt result message. There is no workaround as several error messages are provided as stdout by zypper in non-interactive-mode instead of stderr.
Zypper also does not log the attempt in the example below (/var/log/zypp/history), leaving no indication of the reason.So the following call will produce the observed result with no indication of what went wrong:
salt target pkg.install testpackage
Let's assume testpackage requires package/capability "my-requires-package".
Observed Behaviour
Expected Behaviour
Cause
_Zypper._check_result only checks for stderr when not in xml-mode:
salt/salt/modules/zypperpkg.py
Line 254 in 8d4d5ea
Instead, it should check for stdout as well. One possible solution could be the following snippet producing the expected result (above):
Setup
salt-minion on testhost (s. below)
Steps to Reproduce Issue
salt target pkg.install my-rpm-package-that-zypper-will-not-be-able-to-find-a-provider-for
Versions Report
Note that openSUSE 15.1 maintains the package as 2019.2.0 but for whatever reason already contains zypperpkg.py instead of the old zypper.py module => different /patched version.
Host
The text was updated successfully, but these errors were encountered: