Bug 428861 - Could not find required config file: /etc/mock/default.cfg
Summary: Could not find required config file: /etc/mock/default.cfg
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: mock
Version: el5
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: David Cantrell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-01-15 18:43 UTC by Jeremy Hinegardner
Modified: 2013-01-10 01:46 UTC (History)
1 user (show)

Fixed In Version: 0.9.6
Clone Of:
Environment:
Last Closed: 2008-01-17 14:27:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jeremy Hinegardner 2008-01-15 18:43:44 UTC
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

Comment 1 Jeremy Hinegardner 2008-01-15 19:04:39 UTC
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.

Comment 2 Michael E Brown 2008-01-17 14:27:10 UTC
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.


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