diff --git a/nova/api/openstack/placement/db_api.py b/nova/api/openstack/placement/db_api.py index b01b8d948c6f..792c168a384e 100644 --- a/nova/api/openstack/placement/db_api.py +++ b/nova/api/openstack/placement/db_api.py @@ -20,14 +20,13 @@ from oslo_db.sqlalchemy import enginefacade placement_context_manager = enginefacade.transaction_context() -def _get_db_conf(conf_group, connection=None): - kw = dict(conf_group.items()) - if connection is not None: - kw['connection'] = connection - return kw +def _get_db_conf(conf_group): + return dict(conf_group.items()) def configure(conf): + # If [placement_database]/connection is not set in conf, then placement + # data will be stored in the nova_api database. if conf.placement_database.connection is None: placement_context_manager.configure( **_get_db_conf(conf.api_database)) diff --git a/nova/api/openstack/placement/deploy.py b/nova/api/openstack/placement/deploy.py index 4422411d13b3..281a8d76d316 100644 --- a/nova/api/openstack/placement/deploy.py +++ b/nova/api/openstack/placement/deploy.py @@ -86,7 +86,7 @@ def deploy(conf): def update_database(): """Do any database updates required at process boot time, such as - updating the traits database. + updating the traits table. """ ctx = db_api.DbContext() resource_provider.ensure_trait_sync(ctx) diff --git a/nova/tests/fixtures.py b/nova/tests/fixtures.py index d0d993370600..a8cfc6d26b49 100644 --- a/nova/tests/fixtures.py +++ b/nova/tests/fixtures.py @@ -1717,6 +1717,15 @@ class PlacementFixture(placement.PlacementFixture): It's possible to ask for a specific token when running the fixtures so all calls would be passing this token. + + Most of the time users of this fixture will also want the placement + database fixture (called first) as well: + + self.useFixture(nova_fixtures.Database(database='placement')) + + That is left as a manual step so tests may have fine grain control, and + because it is likely that these fixtures will continue to evolve as + the separation of nova and placement continues. """ def setUp(self):