Bug 962573 - mockchain fails on complicated config files
Summary: mockchain fails on complicated config files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Clark Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-13 22:47 UTC by Ian Burrell
Modified: 2014-04-19 09:21 UTC (History)
3 users (show)

Fixed In Version: mock-1.1.38-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-10 06:37:57 UTC


Attachments (Terms of Use)
Patch to change mockchain config file modification (2.77 KB, patch)
2013-05-13 22:47 UTC, Ian Burrell
no flags Details | Diff

Description Ian Burrell 2013-05-13 22:47:08 UTC
Created attachment 747461 [details]
Patch to change mockchain config file modification

mockchain fails to load config files with complicated keys. For example, this line:

config_opts['plugin_conf']['ccache_enable'] = False

Causes error:

Traceback (most recent call last):
  File "/usr/bin/mockchain", line 336, in <module>
    main(sys.argv)
  File "/usr/bin/mockchain", line 229, in main
    res, msg = add_local_repo(mockcfg, my_mock_config, local_baseurl, 'local_build_repo')
  File "/usr/bin/mockchain", line 93, in add_local_repo
    execfile(infile)
  File "/etc/mock/rtk-centos4-i386.cfg", line 7, in <module>
    config_opts['plugin_conf']['ccache_enable'] = False
KeyError: 'plugin_conf'

This is the problem in bug 903686. There are potential problems with config files that have complicated logic (like += or using other keys) that depend on the defaults or site-defaults.cfg being loaded first. The sample 

Instead of trying to recreate the parsing from mock, the attached patch changes add_local_repo to copy the config file and append lines that modify yum.conf key. The result looks like:

config_opts['yum.conf'] += '\n[local_build_repo]\nname=file:///dp/usr/imb/rpmbuild/CHAIN/results/rtk-centos4-i386\nbaseurl=file:///dp/usr/imb/rpmbuild/CHAIN/results/rtk-centos4-i386\nenabled=1\nskip_if_unavailable=1\nmetadata_expire=30\ncost=1\n'

Comment 1 Clark Williams 2013-05-14 17:13:58 UTC
This is the second time we've had issues with config file stuff between mockchain and mock. I think the real fix here is to break out the configfile init stuff in mock into a loadable module for mockchain's use, so that the same keys are available in config_opts when mockchain starts doing it's thing.

Comment 2 Clark Williams 2013-05-17 20:35:21 UTC
I've modified the mock configuration option routines to live in the mockbuild:util module and now have mockchain calling into util to setup the defaults the same way mock does. 

The changes are in my work branch and I'll push an update next week.

Comment 3 Fedora Update System 2013-08-21 22:55:34 UTC
mock-1.1.33-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.33-1.fc19

Comment 4 Fedora Update System 2013-08-21 22:55:57 UTC
mock-1.1.33-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/mock-1.1.33-1.fc18

Comment 5 Fedora Update System 2013-08-21 22:56:18 UTC
mock-1.1.33-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.33-1.el6

Comment 6 Fedora Update System 2013-08-22 05:48:58 UTC
Package mock-1.1.33-1.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.1.33-1.el6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2013-11294/mock-1.1.33-1.el6
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2013-08-24 22:26:00 UTC
mock-1.1.33-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2013-10-30 14:59:08 UTC
mock-1.1.34-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/mock-1.1.34-1.fc18

Comment 9 Fedora Update System 2013-10-30 15:01:14 UTC
mock-1.1.34-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.34-1.el6

Comment 10 Fedora Update System 2013-10-30 15:03:25 UTC
mock-1.1.34-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.34-1.fc20

Comment 11 Fedora Update System 2013-10-30 15:05:27 UTC
mock-1.1.34-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.34-1.fc19

Comment 12 Fedora Update System 2013-10-30 17:13:09 UTC
Package mock-1.1.34-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.1.34-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-20329/mock-1.1.34-1.fc20
then log in and leave karma (feedback).

Comment 13 Fedora Update System 2013-11-05 05:33:34 UTC
mock-1.1.35-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.35-1.fc19

Comment 14 Fedora Update System 2013-11-05 05:34:56 UTC
mock-1.1.35-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/mock-1.1.35-1.fc18

Comment 15 Fedora Update System 2013-11-05 05:36:16 UTC
mock-1.1.35-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.35-1.el6

Comment 16 Fedora Update System 2013-11-05 05:37:30 UTC
mock-1.1.35-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.35-1.fc20

Comment 17 Fedora Update System 2013-11-10 06:37:57 UTC
mock-1.1.35-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 18 Fedora Update System 2014-02-06 02:10:22 UTC
mock-1.1.36-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.fc19

Comment 19 Fedora Update System 2014-02-06 02:11:55 UTC
mock-1.1.36-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.fc20

Comment 20 Fedora Update System 2014-02-06 02:13:24 UTC
mock-1.1.36-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.el6

Comment 21 Fedora Update System 2014-02-08 05:04:21 UTC
mock-1.1.36-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 22 Fedora Update System 2014-03-25 20:26:30 UTC
mock-1.1.37-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc19

Comment 23 Fedora Update System 2014-03-25 20:28:43 UTC
mock-1.1.37-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc20

Comment 24 Fedora Update System 2014-03-25 20:30:37 UTC
mock-1.1.37-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.el6

Comment 25 Fedora Update System 2014-03-27 17:49:06 UTC
mock-1.1.37-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc20

Comment 26 Fedora Update System 2014-03-27 17:50:59 UTC
mock-1.1.37-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc19

Comment 27 Fedora Update System 2014-03-27 17:53:00 UTC
mock-1.1.37-2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.el6

Comment 28 Fedora Update System 2014-03-31 19:06:03 UTC
mock-1.1.38-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc19

Comment 29 Fedora Update System 2014-03-31 19:08:04 UTC
mock-1.1.38-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.el6

Comment 30 Fedora Update System 2014-03-31 19:10:05 UTC
mock-1.1.38-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc20

Comment 31 Fedora Update System 2014-04-09 13:20:31 UTC
mock-1.1.38-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 32 Fedora Update System 2014-04-18 15:39:08 UTC
mock-1.1.38-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 33 Fedora Update System 2014-04-19 09:21:21 UTC
mock-1.1.38-1.el6 has been pushed to the Fedora EPEL 6 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.