Description of problem: mock assumes the default configuration file name is default.cfg but the one shipping with mock is 'defaults.cfg'. % mock init ERROR:root:Could not find required config file: /etc/mock/default.cfg ERROR:root: Did you forget to specify the chroot to use with '-r'? % ls -l /etc/mock/default* -rw-r--r-- 1 root root 3821 Nov 20 18:04 /etc/mock/defaults.cfg Version-Release number of selected component (if applicable): 0.8.9 How reproducible: Every time Steps to Reproduce: 1. yum install mock 2. mock init Additional info: There may be a more fundamental issue here too. This is a stock CentOS 5 machine and after moving defaults.cfg to default.cfg I get this anytime I run a mock command: INFO: mock.py version 0.8.9 starting... ERROR: 'root' Traceback (most recent call last): File "/usr/libexec/mock.py", line 360, in ? main(retParams) File "/usr/libexec/mock.py", line 299, in main chroot = mock.backend.Root(config_opts, uidManager) File "<string>", line 1, in <lambda> File "/usr/lib/python2.4/site-packages/mock/trace_decorator.py", line 24, in trace result = f(*args, **kw) File "/usr/lib/python2.4/site-packages/mock/backend.py", line 37, in __init__ self.sharedRootName = config['root'] KeyError: 'root' This happens no matter what I try to put for --arch
Okay, fair bit of user error here... looks like default.cfg is generally supposed to be linked to one of the other .cfg's in /etc/mock It isn't by default and that is what was causing my initial error. So change this to just have it figure out a default mock configuration to link to.
For the next release of mock, we have renamed defaults.cfg to site-defaults.cfg to make this situation clearer. It is still up to the end-user to make a default.cfg symlink, or use the '-r CFG' option. This has been pushed as 0.9.6 in rawhide and will be backported to F7/F8 in Feb.