Bug 1253237 - dnf config-manager --setopt options are not saved to repo (--save does not work)
dnf config-manager --setopt options are not saved to repo (--save does not work)
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf-plugins-core (Show other bugs)
22
Unspecified Linux
unspecified Severity medium
: ---
: ---
Assigned To: Michael Mráka
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-13 05:34 EDT by Edgar Hoch
Modified: 2016-07-21 09:30 EDT (History)
9 users (show)

See Also:
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 16:59:11 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Edgar Hoch 2015-08-13 05:34:35 EDT
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 08:07:43 EDT
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 12:46:19 EST
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 12:48:15 EST
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 14:59:11 EST
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 10:34:54 EST
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 16:58:28 EST
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 14:51:46 EST
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 10:36:59 EDT
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 09:30:17 EDT
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

Note You need to log in before you can comment on or make changes to this bug.