From d146f14b3eef9f608c0e03347c135062bade8ced Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sun, 1 Sep 2013 11:15:08 -0400 Subject: Migrate bounceevent.list_name -> bounceevent.list_id * Rename StormBaseDatabase._create() -> .initialize() * Refactor database initialization. * make_listid() helper. * Add a pivot() helper for schema migrations. --- src/mailman/database/base.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/mailman/database/base.py') diff --git a/src/mailman/database/base.py b/src/mailman/database/base.py index 98e30de7c..0b23c8adc 100644 --- a/src/mailman/database/base.py +++ b/src/mailman/database/base.py @@ -27,7 +27,6 @@ import os import sys import logging -from flufl.lock import Lock from lazr.config import as_boolean from pkg_resources import resource_listdir, resource_string from storm.cache import GenerationalCache @@ -60,13 +59,6 @@ class StormBaseDatabase: self.url = None self.store = None - def initialize(self, debug=None): - """See `IDatabase`.""" - # Serialize this so we don't get multiple processes trying to create - # the database at the same time. - with Lock(os.path.join(config.LOCK_DIR, 'dbcreate.lck')): - self._create(debug) - def begin(self): """See `IDatabase`.""" # Storm takes care of this for us. @@ -117,7 +109,8 @@ class StormBaseDatabase: """ pass - def _create(self, debug): + def initialize(self, debug=None): + """See `IDatabase`.""" # Calculate the engine url. url = expand(config.database.url, config.paths) log.debug('Database url: %s', url) -- cgit v1.2.3-70-g09d2