Bug 1253237

Summary: dnf config-manager --setopt options are not saved to repo (--save does not work)
Product: [Fedora] Fedora Reporter: Edgar Hoch <edgar.hoch>
Component: dnf-plugins-coreAssignee: Michael Mráka <mmraka>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 22CC: jsilhan, jzeleny, mluscon, mmraka, packaging-team-maint, pnemade, red, tim.lauridsen, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: dnf-plugins-core-0.1.15-1.fc23 dnf-plugins-core-0.1.15-1.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-22 21:59:11 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 Edgar Hoch 2015-08-13 09:34:35 UTC
Description of problem:
Setting options of a repo with

dnf config-manager --setopt option=value --save reponame

doesn not work. The option is not saved in the repo file.


Version-Release number of selected component (if applicable):
dnf-plugins-core-0.1.10-1.fc22.noarch
dnf-1.1.0-1.fc22.noarch

How reproducible:
Always

Steps to Reproduce:
1. Install a repo, for example
   dnf -y install http://remi.schlundtech.de/fedora/remi-release-22.rpm
2. Check that the option to set is not in the repo file, for example
   grep include /etc/yum.repos.d/remi.repo
   dnf config-manager --dump remi | grep include
3. Set an option of that repo, for example
   dnf config-manager --setopt "include=libdvdcss" --save remi
4. Check if the option is in the repo file, for example
   grep include /etc/yum.repos.d/remi.repo
   dnf config-manager --dump remi | grep include


Actual results:
The option is not written to the repo file, the file is unchanged.
In the example, the include option is not in the file resp. the dump is the same.

Expected results:
The option is written to the repo file.
In the example, the include option is in the file resp. the dump has changed.


Additional info:
The behaviour is independent whether the repo is enabled or not.

The bug is independent of the problem that the include statement has no effect currently: 
Bug 1055910 - [rfe] includes directive support should work with no excludes defined

Comment 1 Honza Silhan 2015-08-19 12:07:43 UTC
Confirmed it does not work but it worked. We should find whether it's regression in DNF or config-manager itself.

Comment 3 Fedora Update System 2015-12-18 17:46:19 UTC
dnf-plugins-core-0.1.15-1.fc23 dnf-1.1.5-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-c72cd24fa0

Comment 4 Fedora Update System 2015-12-18 17:48:15 UTC
dnf-plugins-core-0.1.15-1.fc22 dnf-1.1.5-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-1bb112ccc6

Comment 5 Fedora Update System 2015-12-19 19:59:11 UTC
dnf-1.1.5-1.fc23, dnf-plugins-core-0.1.15-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update dnf dnf-plugins-core'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-c72cd24fa0

Comment 6 Fedora Update System 2015-12-22 15:34:54 UTC
dnf-1.1.5-1.fc22, dnf-plugins-core-0.1.15-1.fc22 has been pushed to the Fedora 22 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-2015-1bb112ccc6

Comment 7 Fedora Update System 2015-12-22 21:58:28 UTC
dnf-1.1.5-1.fc23, dnf-plugins-core-0.1.15-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2016-01-04 19:51:46 UTC
dnf-1.1.5-1.fc22, dnf-plugins-core-0.1.15-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Davide Repetto 2016-06-08 14:36:59 UTC
Not working again in Fedora23. Exact same problem:
==================================================
# dnf config-manager --save --setopt anyreponame.priority=120
# grep prior /etc/yum.repos.d/anyreponame.rpm
(no output!)

On the same machine: 
====================
# yum-config-manager --setopt anyreponame.priority=120 -save
# grep prior /etc/yum.repos.d/anyreponame.rpm
priority = 120

if dnf config-manager is launched after the latter:
===================================================
# dnf config-manager --save --setopt anyreponame.priority=120
# grep prior /etc/yum.repos.d/anyreponame.rpm
priority=120
^^^^^^^^^^^^
Here it removed the spaces in the "priority = 120 line"
So it parses the old values and writes them back instead of writing the new ones.

# relevant version of dnf components:
=====================================
dnf-1.1.9-2.fc23.noarch
dnf-conf-1.1.9-2.fc23.noarch
dnfdaemon-0.3.16-1.fc23.noarch
dnf-langpacks-0.15.1-1.fc23.noarch
dnf-langpacks-conf-0.15.1-1.fc23.noarch
dnf-plugins-core-0.1.21-2.fc23.noarch
dnf-plugin-system-upgrade-0.7.1-1.fc23.noarch
dnf-yum-1.1.9-2.fc23.noarch

Comment 10 Michael Mráka 2016-07-21 13:30:17 UTC
Interesting... For me (F23) neither
 # dnf config-manager --save --setopt anyreponame.priority=120
nor
 # yum-config-manager --setopt anyreponame.priority=120 -save
works... 


What works is
# dnf config-manager --save --setopt priority=120 anyreponame


dnf-1.1.9-2.fc23.noarch
dnf-plugins-core-0.1.21-2.fc23.noarch