Bug 1512457

Summary: when you feed "-c" option with nonexistent file, dnf still returns 0
Product: [Fedora] Fedora Reporter: Jan Hutař <jhutar>
Component: dnfAssignee: Jan Beran <jberan>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: medium    
Version: 29CC: dmach, jberan, jmracek, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.2.5-4.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-31 01:38:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Hutař 2017-11-13 09:44:34 UTC
Description of problem:
When you feed "-c" option in `dnf -c /etc/does-not-exist.conf` with nonexistent file, dnf still returns 0


Version-Release number of selected component (if applicable):
dnf-2.7.5-1.fc26.noarch


How reproducible:
always


Steps to Reproduce:
1. Non-existing file:
   # dnf -c /etc/yum-c-that-does-not-exists.conf repolist; echo $?
2. Parameter missing at all:
   # dnf -c repolist; echo $?


Actual results:
Return code is 0 in both cases. E.g. in first case dnf says:

    Can not read configuration: /etc/yum-c-that-does-not-exists.conf , ignoring

but returns 0.


Expected results:
This is difference when compared to yum. IMO should be consistent (in case you are automating something, it is better to fail fast.

Comment 1 Fedora End Of Life 2018-05-03 08:53:18 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 2 Jan Kurik 2018-08-14 11:00:08 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 4 Fedora Update System 2019-08-14 07:23:51 UTC
FEDORA-2019-d4b6ede072 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-d4b6ede072

Comment 5 Fedora Update System 2019-08-16 20:12:15 UTC
dnf-4.2.5-4.fc29, dnf-plugins-extras-4.0.4-2.fc29, libdnf-0.31.0-6.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-d4b6ede072

Comment 6 Fedora Update System 2019-08-31 01:38:41 UTC
dnf-4.2.5-4.fc29, dnf-plugins-extras-4.0.4-2.fc29, libdnf-0.31.0-6.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.