~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/testing/layers.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-09-21 12:59:32 UTC
  • mfrom: (13993.1.7 overridable-dbconfig)
  • Revision ID: launchpad@pqm.canonical.com-20110921125932-vandcom75qi3zkib
[r=stevenk][no-qa] Allow DatabaseConfig's settings to be overridden
 without dealing with config overlay stacks and config sections.

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
    sure the right data is available.
218
218
    """
219
219
    disconnect_stores()
220
 
    dbconfig.setConfigSection(database_config_section)
 
220
    section = getattr(config, database_config_section)
 
221
    dbconfig.override(
 
222
        dbuser=getattr(section, 'dbuser', None),
 
223
        isolation_level=getattr(section, 'isolation_level', None))
221
224
 
222
225
    main_store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
223
226
    assert main_store is not None, 'Failed to reconnect'