Merge "replace string format arguments with function parameters"

This commit is contained in:
Jenkins 2014-06-05 22:00:23 +00:00 committed by Gerrit Code Review
commit ad10af347c
4 changed files with 10 additions and 9 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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().\