Bug 1162595 - lvm_root_opts options in site-defaults.cfg don't work
Summary: lvm_root_opts options in site-defaults.cfg don't work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-11 11:21 UTC by Vít Ondruch
Modified: 2015-01-06 02:06 UTC (History)
6 users (show)

Fixed In Version: mock-1.2.3-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-12 04:07:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Vít Ondruch 2014-11-11 11:21:24 UTC
Description of problem:

The site-defaults.cfg contains documentation lines such as:

config_opts['plugin_conf']['lvm_root_opts']['volume_group'] = 'my_vg'

But when I tried to enable similar line, I just got following error:

  File "/etc/mock/site-defaults.cfg", line 126, in <module>
    config_opts['plugin_conf']['lvm_root_opts']['volume_group'] = 'vg_fedora'

KeyError: 'lvm_root_opts'

ERROR: Error in configuration



Version-Release number of selected component (if applicable):
$ rpm -q mock
mock-1.2.0-1.fc20.noarch


How reproducible:


Steps to Reproduce:
1. enable some of config_opts['plugin_conf']['lvm_root_opts'] lines in site-defaults.cfg
2.
3.

Actual results:
  File "/etc/mock/site-defaults.cfg", line 126, in <module>
    config_opts['plugin_conf']['lvm_root_opts']['volume_group'] = 'vg_fedora'

KeyError: 'lvm_root_opts'

ERROR: Error in configuration



Expected results:
No error.


Additional info:
According to [1], the configuration should look like 

config_opts['plugin_conf']['lvm_root_opts'] = {
    'volume_group': 'my-volume-group',
}

which works for me.

[1] http://xpath-of-light.blogspot.cz/2014/10/new-features-in-mock-12.html

Comment 1 Michael Simacek 2014-11-11 11:40:13 UTC
It's a python dictionary, so the first form fails becuase it reads nonexistent key, while the other one writes it. I agree that it's counterintuitive and the plugin_conf dictionaries for plugins distributed with mock should be prepopulated (or use some form of defaultdict).

Comment 2 Miroslav Suchý 2014-11-12 12:06:10 UTC
KISS. Put in example initialization of that dictionary.
Fixed in commit 89e93ec

Comment 3 Fedora Update System 2014-11-16 17:37:12 UTC
mock-1.2.1-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc21

Comment 4 Fedora Update System 2014-11-16 17:38:37 UTC
mock-1.2.1-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc20

Comment 5 Fedora Update System 2014-11-16 17:39:28 UTC
mock-1.2.1-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.el7

Comment 6 Fedora Update System 2014-11-16 17:40:26 UTC
mock-1.2.1-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.el6

Comment 7 Vít Ondruch 2014-11-16 18:38:09 UTC
(In reply to Miroslav Suchý from comment #2)
> KISS. Put in example initialization of that dictionary.
> Fixed in commit 89e93ec

Well, shouldn't be the lines such as "config_opts['plugin_conf']['lvm_root_opts'] = {}" uncommented by default? Not sure I could figure out I'm supposed to uncomment this line when I want to use the later options.

Comment 8 Fedora Update System 2014-11-17 06:29:31 UTC
Package mock-1.2.1-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mock-1.2.1-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-15217/mock-1.2.1-1.fc20
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2014-12-04 12:06:51 UTC
mock-1.2.3-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc21

Comment 10 Fedora Update System 2014-12-04 12:10:20 UTC
mock-1.2.3-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc20

Comment 11 Fedora Update System 2014-12-04 12:11:17 UTC
mock-1.2.3-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.el7

Comment 12 Fedora Update System 2014-12-12 04:07:45 UTC
mock-1.2.3-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2014-12-17 04:42:49 UTC
mock-1.2.3-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2015-01-06 02:06:33 UTC
mock-1.2.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.


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