Merge "storage: fix clear/upgrade order"
This commit is contained in:
commit
962c6a9533
@ -286,6 +286,12 @@ class Connection(base.Connection):
|
||||
if 'username' in opts:
|
||||
self.db.authenticate(opts['username'], opts['password'])
|
||||
|
||||
# NOTE(jd) Upgrading is just about creating index, so let's do this
|
||||
# on connection to be sure at least the TTL is correcly updated if
|
||||
# needed.
|
||||
self.upgrade()
|
||||
|
||||
def upgrade(self, version=None):
|
||||
# Establish indexes
|
||||
#
|
||||
# We need variations for user_id vs. project_id because of the
|
||||
@ -341,10 +347,6 @@ class Connection(base.Connection):
|
||||
# Assume is not supported if we can get the version
|
||||
return self.conn.server_info().get('versionArray', []) >= [2, 2]
|
||||
|
||||
@staticmethod
|
||||
def upgrade(version=None):
|
||||
pass
|
||||
|
||||
def clear(self):
|
||||
self.conn.drop_database(self.db)
|
||||
|
||||
|
@ -34,3 +34,4 @@ class TestBase(test_base.TestCase):
|
||||
self.conn = storage.get_connection(cfg.CONF)
|
||||
self.conn.upgrade()
|
||||
self.conn.clear()
|
||||
self.conn.upgrade()
|
||||
|
Loading…
Reference in New Issue
Block a user