Permalink
Browse files

Ensure provision_new_database is True by default

In I3e238b6a97769cf0a352f11e718d5d73eebcfa8a, we restored
zzzeek's overlooking the fact that legacy test suites assume
new DBs are provisioned by default in the legacy test base.
However, zzzeek also made this same assumption in Neutron
Ie27cf174fa24c2f479af47335d9ae139fb7d159a which vendors its
own version of test_base in anticipation of some of these newer
features, so it will break once the provision_new_database flag
becomes false.  Favor setting this flag True/False explicitly
and default it to True for compatibility w/ Neutron.

Change-Id: I726cc20481a9bc778b75564526d9245132b43563
  • Loading branch information...
1 parent c8c635e commit e03b0dd06940a9262d90ec2699a4452835c05b56 @zzzeek zzzeek committed Nov 29, 2016
Showing with 5 additions and 3 deletions.
  1. +1 −1 oslo_db/sqlalchemy/provision.py
  2. +4 −2 oslo_db/sqlalchemy/test_fixtures.py
@@ -111,7 +111,7 @@ class DatabaseResource(testresources.TestResourceManager):
"""
def __init__(self, database_type, _enginefacade=None,
- provision_new_database=False, ad_hoc_url=None):
+ provision_new_database=True, ad_hoc_url=None):
super(DatabaseResource, self).__init__()
self.database_type = database_type
self.provision_new_database = provision_new_database
@@ -324,7 +324,8 @@ def _get_provisioned_db(self):
return self._dependency_resources["_db_%s" % self.ident]
def _generate_database_resource(self, _enginefacade):
- return provision.DatabaseResource(self.driver, _enginefacade)
+ return provision.DatabaseResource(self.driver, _enginefacade,
+ provision_new_database=False)
def _setUp(self):
super(SimpleDbFixture, self)._setUp()
@@ -392,7 +393,8 @@ def __init__(self, url=None):
def _generate_database_resource(self, _enginefacade):
return provision.DatabaseResource(
- self.driver, _enginefacade, ad_hoc_url=self.url)
+ self.driver, _enginefacade, ad_hoc_url=self.url,
+ provision_new_database=False)
def _cleanup(self):
self._teardown_resources()

0 comments on commit e03b0dd

Please sign in to comment.