Bug 365721 - mock No section: 'formatters'
mock No section: 'formatters'
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
7
All Linux
high Severity high
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-04 05:56 EST by Ralf Corsepius
Modified: 2013-01-09 20:43 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-05 00:51:42 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ralf Corsepius 2007-11-04 05:56:37 EST
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 05:57:26 EST
Oops, forgot the version: mock-0.8.4-2.fc7
Comment 2 Michael E Brown 2007-11-05 00:51:42 EST
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 01:29:12 EST
(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 02:21:38 EST
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.