summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-06-05 22:00:23 +0000
committerGerrit Code Review <review@openstack.org>2014-06-05 22:00:23 +0000
commitad10af347c6530e4cb33bf12ca80a39f5f34d214 (patch)
tree2b65f378a45286c55fd7b339a389b5f83913bfc4
parent06224bcd735a814b78f7c6ffffc1075cced25503 (diff)
parentd09fff66407a8f24ef724cafb69b04311ec11f7d (diff)
downloadoslo-db-ad10af347c6530e4cb33bf12ca80a39f5f34d214.tar.gz
Merge "replace string format arguments with function parameters"
-rw-r--r--oslo/db/sqlalchemy/provision.py2
-rw-r--r--oslo/db/sqlalchemy/session.py2
-rw-r--r--oslo/db/sqlalchemy/test_migrations.py13
-rw-r--r--oslo/db/sqlalchemy/utils.py2
4 files changed, 10 insertions, 9 deletions
diff --git a/oslo/db/sqlalchemy/provision.py b/oslo/db/sqlalchemy/provision.py
index 598305b..317d7f9 100644
--- a/oslo/db/sqlalchemy/provision.py
+++ b/oslo/db/sqlalchemy/provision.py
@@ -52,7 +52,7 @@ def _execute_sql(engine, sql, driver):
except sqlalchemy.exc.OperationalError:
msg = ('%s does not match database admin '
'credentials or database does not exist.')
- LOG.exception(msg % engine.url)
+ LOG.exception(msg, engine.url)
raise exc.DBConnectionError(msg % engine.url)
diff --git a/oslo/db/sqlalchemy/session.py b/oslo/db/sqlalchemy/session.py
index c97f682..661fba6 100644
--- a/oslo/db/sqlalchemy/session.py
+++ b/oslo/db/sqlalchemy/session.py
@@ -671,7 +671,7 @@ def create_engine(sql_connection, sqlite_fk=False, mysql_sql_mode=None,
remaining = 'infinite'
while True:
msg = _LW('SQL connection failed. %s attempts left.')
- LOG.warning(msg % remaining)
+ LOG.warning(msg, remaining)
if remaining != 'infinite':
remaining -= 1
time.sleep(retry_interval)
diff --git a/oslo/db/sqlalchemy/test_migrations.py b/oslo/db/sqlalchemy/test_migrations.py
index 661b0a7..5972d03 100644
--- a/oslo/db/sqlalchemy/test_migrations.py
+++ b/oslo/db/sqlalchemy/test_migrations.py
@@ -60,10 +60,10 @@ def _set_db_lock(lock_path=None, lock_prefix=None):
path = lock_path or os.environ.get("OSLO_LOCK_PATH")
lock = lockfile.FileLock(os.path.join(path, lock_prefix))
with lock:
- LOG.debug('Got lock "%s"' % f.__name__)
+ LOG.debug('Got lock "%s"', f.__name__)
return f(*args, **kwargs)
finally:
- LOG.debug('Lock released "%s"' % f.__name__)
+ LOG.debug('Lock released "%s"', f.__name__)
return wrapper
return decorator
@@ -88,7 +88,7 @@ class BaseMigrationTestCase(test_base.BaseTestCase):
# Load test databases from the config file. Only do this
# once. No need to re-run this on each test...
- LOG.debug('config_path is %s' % self.CONFIG_FILE_PATH)
+ LOG.debug('config_path is %s', self.CONFIG_FILE_PATH)
if os.path.exists(self.CONFIG_FILE_PATH):
cp = moves.configparser.RawConfigParser()
try:
@@ -193,7 +193,7 @@ class WalkVersionsMixin(object):
self.migration_api.db_version(engine,
self.REPOSITORY))
- LOG.debug('latest version is %s' % self.REPOSITORY.latest)
+ LOG.debug('latest version is %s', self.REPOSITORY.latest)
versions = range(self.INIT_VERSION + 1, self.REPOSITORY.latest + 1)
for version in versions:
@@ -264,6 +264,7 @@ class WalkVersionsMixin(object):
if check:
check(engine, data)
except Exception:
- LOG.error(_LE("Failed to migrate to version %s on engine %s") %
- (version, engine))
+ LOG.error(_LE("Failed to migrate to version %(version)s on "
+ "engine %(engine)s"), {'version': version,
+ 'engine': engine})
raise
diff --git a/oslo/db/sqlalchemy/utils.py b/oslo/db/sqlalchemy/utils.py
index 4e17fc7..12ffcd9 100644
--- a/oslo/db/sqlalchemy/utils.py
+++ b/oslo/db/sqlalchemy/utils.py
@@ -385,7 +385,7 @@ def drop_old_duplicate_entries_from_table(migrate_engine, table_name,
[table.c.id]).where(delete_condition)
for row in migrate_engine.execute(rows_to_delete_select).fetchall():
LOG.info(_LI("Deleting duplicated row with id: %(id)s from table: "
- "%(table)s") % dict(id=row[0], table=table_name))
+ "%(table)s"), dict(id=row[0], table=table_name))
if use_soft_delete:
delete_statement = table.update().\