Fix message formatting in glance-manage purge

Info messages in glance-manage purge method shows variable names
in the message and not the corresponding values.

Used actual variable names instead of local() method to show
their values.

Change-Id: Ie8600d43a638b34a39cc58b9d1869e91eafb102b
Closes-Bug: #1544437
This commit is contained in:
Dinesh Bhor 2016-02-11 02:33:54 -08:00 committed by dineshbhor
parent 5fa3e88cb6
commit 117642393a
1 changed files with 3 additions and 4 deletions

View File

@ -1270,7 +1270,7 @@ def purge_deleted_rows(context, age_in_days, max_rows, session=None):
tables.remove(tbl)
except ValueError:
LOG.warning(_LW('Expected table %(tbl)s was not found in DB.'),
**locals())
{'tbl': tbl})
else:
tables.append(tbl)
@ -1279,8 +1279,7 @@ def purge_deleted_rows(context, age_in_days, max_rows, session=None):
LOG.info(
_LI('Purging deleted rows older than %(age_in_days)d day(s) '
'from table %(tbl)s'),
**locals()
)
{'age_in_days': age_in_days, 'tbl': tbl})
with session.begin():
result = session.execute(
tab.delete().where(
@ -1293,7 +1292,7 @@ def purge_deleted_rows(context, age_in_days, max_rows, session=None):
)
rows = result.rowcount
LOG.info(_LI('Deleted %(rows)d row(s) from table %(tbl)s'),
**locals())
{'rows': rows, 'tbl': tbl})
def user_get_storage_usage(context, owner_id, image_id=None, session=None):