Bug 365721 - mock No section: 'formatters'
Summary: mock No section: 'formatters'
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 7
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: David Cantrell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-04 10:56 UTC by Ralf Corsepius
Modified: 2013-01-10 01:43 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-05 05:51:42 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ralf Corsepius 2007-11-04 10:56:37 UTC
Description of problem:

mock doesn't support custom *.cfgs.

Version-Release number of selected component (if applicable):


How reproducible:
Deterministic.


Steps to Reproduce:
1. mkdir foo
2. cp /etc/mock/fedora-7-i386.cfg foo/fedora-7-i386-test.cfg
3. mock --configdir=.../foo -r fedora-7-i386-test init
  
Actual results:

# mock --configdir=.../foo -r fedora-7-i386-test init
INFO: mock suid wrapper version 0.8.4 
ERROR:root:No section: 'formatters'
Traceback (most recent call last):
  File "/usr/libexec/mock.py", line 333, in <module>
    main(retParams)
  File "/usr/libexec/mock.py", line 239, in main
    logging.config.fileConfig(os.path.join(config_path,
config_opts["log_config_file"]))
  File "/usr/lib/python2.5/logging/config.py", line 76, in fileConfig
    formatters = _create_formatters(cp)
  File "/usr/lib/python2.5/logging/config.py", line 107, in _create_formatters
    flist = cp.get("formatters", "keys")
  File "/usr/lib/python2.5/ConfigParser.py", line 511, in get
    raise NoSectionError(section)
NoSectionError: No section: 'formatters'


Expected results:
function.

This bug renders mock as unusable as build-infrastructure for 3rd party repos.

Comment 1 Ralf Corsepius 2007-11-04 10:57:26 UTC
Oops, forgot the version: mock-0.8.4-2.fc7


Comment 2 Michael E Brown 2007-11-05 05:51:42 UTC
You need a 'logging.ini' in the --configdir specified. Just copy the default one
from /etc/mock. Mock 0.8.5 has a better error message for this and will be
released within the next couple weeks.

Comment 3 Ralf Corsepius 2007-11-05 06:29:12 UTC
(In reply to comment #2)
> You need a 'logging.ini' in the --configdir specified. Just copy the default one
> from /etc/mock. Mock 0.8.5 has a better error message for this and will be
> released within the next couple weeks.
OK, partial success.
 
But why doesn't yum pick up logging.ini from the default location (i.e. treat
--configdir as a search-path? This way, mock-0.8.4 would have stayed backward
compatible  and would not have broken existing configurations.


However, with logging.ini copied over to .../foo, my formerly functional
configurations still fail:

# mock --configdir=/users/rtems/mock/etc/mock -r fedora-7-i386-rtems4.9 init
INFO: mock suid wrapper version 0.8.4 
ERROR: unsupported operand type(s) for +=: 'dict' and 'str'
Traceback (most recent call last):
  File "/usr/libexec/mock.py", line 333, in <module>
    main(retParams)
  File "/usr/libexec/mock.py", line 249, in main
    execfile(cfg)
  File "/users/rtems/mock/etc/mock/fedora-7-i386-rtems4.9.cfg", line 7, in <module>
    config_opts['macros'] += '%vendor   RTEMS Project http://www.rtems.org'
TypeError: unsupported operand type(s) for +=: 'dict' and 'str'

Background: I have
config_opts['macros'] += '%vendor   RTEMS Project http://www.rtems.org'

In my customized *.cfgs


Comment 4 Michael E Brown 2007-11-05 07:21:38 UTC
look in defaults.cfg for the new format for adding rpm macros.

I believe that the release notes covered the changes to configuration option
handling for this specific option.

config_opts['macros']['%your_macro_name'] = 'your macro value'

There were a small handful of configuration options that changed for mock 0.8,
but I tried to keep as much compatibility as possible. Most of the instances I
am aware of were covered in the release announcement and release notes. I have
0.8.5 almost ready which fixes some small documentation problems and a few other
small issues.

Look in defaults.cfg for docs for all the currently available config options.




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