From 8bd37bb2ca74d79373bb190c9b7ca138b2d2bbca Mon Sep 17 00:00:00 2001 From: Gordon Chung Date: Tue, 4 Jun 2013 11:48:57 -0400 Subject: [PATCH] fix session connection previous session flushing fix caused conflict between database_connection and [database]connection values. correct the behaviour in this fix. also, remove empty return statement at end of record_metering_data function. Change-Id: I3b2525cec05f5ee2ee8277bfbdca52b9a768974b --- ceilometer/storage/__init__.py | 3 ++- ceilometer/storage/impl_mongodb.py | 1 - ceilometer/storage/impl_sqlalchemy.py | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ceilometer/storage/__init__.py b/ceilometer/storage/__init__.py index 40e0252e8..1e8c9ba1f 100644 --- a/ceilometer/storage/__init__.py +++ b/ceilometer/storage/__init__.py @@ -59,7 +59,8 @@ def register_opts(conf): def get_engine(conf): """Load the configured engine and return an instance.""" if conf.database_connection: - conf.database.connection = conf.database_connection + conf.set_override('connection', conf.database_connection, + group='database') engine_name = urlparse.urlparse(conf.database.connection).scheme LOG.debug('looking for %r driver in %r', engine_name, STORAGE_ENGINE_NAMESPACE) diff --git a/ceilometer/storage/impl_mongodb.py b/ceilometer/storage/impl_mongodb.py index e416561b2..c250638a0 100644 --- a/ceilometer/storage/impl_mongodb.py +++ b/ceilometer/storage/impl_mongodb.py @@ -322,7 +322,6 @@ class Connection(base.Connection): # a new key '_id'). record = copy.copy(data) self.db.meter.insert(record) - return def get_users(self, source=None): """Return an iterable of user id strings. diff --git a/ceilometer/storage/impl_sqlalchemy.py b/ceilometer/storage/impl_sqlalchemy.py index 107e4fcd0..91c1e04c3 100644 --- a/ceilometer/storage/impl_sqlalchemy.py +++ b/ceilometer/storage/impl_sqlalchemy.py @@ -212,8 +212,6 @@ class Connection(base.Connection): meter.message_id = data['message_id'] session.flush() - return - def get_users(self, source=None): """Return an iterable of user id strings.