Project

Profile

Help

Issue #1409

closed

config loading methods are calling in the wrong order

Added by semyers over 8 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Master
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

bmbouter brought this to my attention:

ERROR: test suite for <module 'test.unit' from '/home/vagrant/devel/pulp_rpm/plugins/test/unit/__init__.py'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/.virtualenvs/pulp_rpm/lib/python2.7/site-packages/nose/suite.py", line 209, in run
    self.setUp()
  File "/home/vagrant/.virtualenvs/pulp_rpm/lib/python2.7/site-packages/nose/suite.py", line 292, in setUp
    self.setupContext(ancestor)   
  File "/home/vagrant/.virtualenvs/pulp_rpm/lib/python2.7/site-packages/nose/suite.py", line 315, in setupContext
    try_run(context, names)
  File "/home/vagrant/.virtualenvs/pulp_rpm/lib/python2.7/site-packages/nose/util.py", line 471, in try_run
    return func()
  File "/home/vagrant/devel/pulp_rpm/plugins/test/unit/__init__.py", line 13, in setup
    devel_base.start_database_connection()
  File "/home/vagrant/devel/pulp/devel/pulp/devel/unit/server/base.py", line 24, in start_database_connection
    _load_test_config()
  File "/home/vagrant/devel/pulp/devel/pulp/devel/unit/server/base.py", line 54, in _load_test_config
    start_logging()
  File "/home/vagrant/devel/pulp/server/pulp/server/logs.py", line 46, in start_logging
    log_level = config.config.get('server', 'log_level')
  File "/usr/lib64/python2.7/ConfigParser.py", line 604, in get
    sectiondict = self._sections[section]
  File "/home/vagrant/devel/pulp/server/pulp/server/config.py", line 23, in _sections
    self._load_config()
  File "/home/vagrant/devel/pulp/server/pulp/server/config.py", line 38, in _load_config
    self.set(section, option, value)
  File "/home/vagrant/devel/pulp/devel/pulp/devel/unit/server/base.py", line 40, in _enforce_config
    raise Exception("Do not change the config during test runs! Please use "
Exception: Do not change the config during test runs! Please use pulp.devel.mock_config.patch instead.

This is related to some changes that I put into place in #607. config alterations are being blocked in _load_test_config(), but they should not be.

The fix probably involves changing the order of funciton calls in _load_test_config to be more explicit about the server config state during loading, while still ensuring that attempts to alter the config during a test run are properly blocked.

Whether those attempts should be blocked is another issue entirely. :)

This is blocking at least one team member from completing his work on the 2.8 release, so I'm filing this as High Priority/Severity and self-assigning it.


Related issues

Related to Pulp - Issue #607: server/config.py reads server.conf when the module is loaded.CLOSED - CURRENTRELEASEsemyersActions

Also available in: Atom PDF