From: Angus Salkeld Date: Mon, 7 May 2012 08:27:35 +0000 (+1000) Subject: Fix undefined LOG variable in db.session X-Git-Tag: 2014.1~1873 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c3b0fe9ff52a23e2253a295f86d61e580e75713e;p=openstack-build%2Fheat-build.git Fix undefined LOG variable in db.session Signed-off-by: Angus Salkeld --- diff --git a/heat/db/sqlalchemy/session.py b/heat/db/sqlalchemy/session.py index 9248e40a..b90cf0b7 100644 --- a/heat/db/sqlalchemy/session.py +++ b/heat/db/sqlalchemy/session.py @@ -13,12 +13,16 @@ # under the License. """Session Handling for SQLAlchemy backend.""" + +import logging import sqlalchemy.interfaces import sqlalchemy.orm from sqlalchemy.exc import DisconnectionError -from heat.openstack.common import cfg + from heat.db import api as db_api +from heat.openstack.common import cfg +logger = logging.getLogger(__file__) _ENGINE = None _MAKER = None @@ -41,7 +45,7 @@ def _wrap_db_error(f): except UnicodeEncodeError: raise InvalidUnicodeParameter() except Exception, e: - LOG.exception(_('DB exception wrapped.')) + logger.exception(_('DB exception wrapped.')) raise DBError(e) _wrap.func_name = f.func_name return _wrap @@ -83,7 +87,7 @@ class MySQLPingListener(object): dbapi_con.cursor().execute('select 1') except dbapi_con.OperationalError, ex: if ex.args[0] in (2006, 2013, 2014, 2045, 2055): - LOG.warn('Got mysql server has gone away: %s', ex) + logger.warn('Got mysql server has gone away: %s', ex) raise DisconnectionError("Database server went away") else: raise