Skip to content

Commit

Permalink
Ensure provision_new_database is True by default
Browse files Browse the repository at this point in the history
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
zzzeek committed Nov 29, 2016
1 parent c8c635e commit e03b0dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion oslo_db/sqlalchemy/provision.py
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions oslo_db/sqlalchemy/test_fixtures.py
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit e03b0dd

Please sign in to comment.