-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnf history list
and dnf history info
do not return non-zero exit status when transactions not found for package failure occurs
#2213
Comments
Require one transaction ID for history command actions "list" and "info" = changelog = msg: Require one transaction ID for history list + info type: bugfix resolves: rpm-software-management#2213
Hello, personally I worry that such a change now could break more users than it would help. In addition dnf query commands in general behave like this:
On the other hand the
|
Hello @kontura, thank you for sharing that as a mitigation
I agree - I would highly suggest that this difference be added to the existing "Changes in DNF CLI compared to YUM" section to fill in the documentation gap. This way, affected users also have an easily accessible point of reference for this issue. To clarify, is the page source for the documentation also maintained in Github? If so, please feel free to direct me to the appropriate repository and I would be happy to contribute a documentation update to address this issue. Otherwise, please assist with engaging the responsible maintainers of the documentation to fill in the documentation gap. |
Great, I think it should be in this very same repo: https://github.com/rpm-software-management/dnf/blob/master/doc/cli_vs_yum.rst |
Thank you for clarifying @kontura! I have raised a pull request accordingly here: #2220. |
Summary
dnf history
subcommandslist
andinfo
do not return non-zero exit status when they fail to find transactions for a specified package/<package-name-spec>
. This is a bug or undocumented behavior change relative to the correspondingyum history package-list
andyum history list
(based on this available documentation).Use Case
Customers may run the aforementioned history commands in their workflows and take specific actions based on if a non-zero exit status is returned or not. If they migrate to start using
dnf
instead ofyum
, these workflows may unexpectedly begin taking undesired actions.For example, a customer may have a workflow that:
yum history package-list docker
(ifyum
is being used) ordnf history list docker
(ifdnf
is being used)docker
packagedocker
packageIn the case where
dnf
is being used, the customer's workflow will proceed to perform an action that makes use ofdocker
package even in the event that no transactions (including install) exist for thedocker
package. Such action is undesirable for the customer.Ideally,
dnf
should match theyum
behavior in this case so that customers can reliably detect errors in finding transactions for a given package when running these commands and act accordingly.Current
yum
BehaviorRunning
yum history package-list docker
andyum history list docker
on an instance withdocker
not installed returns a non-zero exit status and an error message is written tostderr
.Click here to expand for full output of commands
Expected
dnf
BehaviorRunning
dnf history list docker
anddnf history info docker
on an instance withdocker
not installed returns a non-zero exit status and an error message is written tostderr
. This aligns with the currentyum
behavior.Observed
dnf
BehaviorRunning
dnf history list docker
anddnf history info docker
on an instance withdocker
not installed returns an exit status of 0 and no error message is written tostderr
.Click here to expand for full output of commands
Environment Details
Instance used to run
yum
commands is an Amazon Linux 2 x86_64 architecture instance with the below version ofyum
installed:Instance used to run
dnf
commands is an Amazon Linux 2023 x86_64 architecture instance with the below version ofdnf
installed:The text was updated successfully, but these errors were encountered: