Bug 1162595

Summary: lvm_root_opts options in site-defaults.cfg don't work
Product: [Fedora] Fedora Reporter: Vít Ondruch <vondruch>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: jdisnard, mebrown, msimacek, msuchy, praiskup, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mock-1.2.3-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-12 04:07:45 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 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.