Handle log message interpolation by the logger in backup/
According to OpenStack Guideline[1], logged string message should be interpolated by the logger. [1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages Change-Id: Ia79addd292000dfd1e3ecb15884b8dccac4d9284 Related-Bug: #1642552
This commit is contained in:
parent
3d3181f56f
commit
692938fbf6
@ -344,11 +344,11 @@ class DBBackup(DatabaseModelBase):
|
|||||||
obj = parts[-1]
|
obj = parts[-1]
|
||||||
container = parts[-2]
|
container = parts[-2]
|
||||||
client = create_swift_client(context)
|
client = create_swift_client(context)
|
||||||
LOG.debug("Checking if backup exists in %s" % self.location)
|
LOG.debug("Checking if backup exists in %s", self.location)
|
||||||
resp = client.head_object(container, obj)
|
resp = client.head_object(container, obj)
|
||||||
if verify_checksum:
|
if verify_checksum:
|
||||||
LOG.debug("Checking if backup checksum matches swift "
|
LOG.debug("Checking if backup checksum matches swift "
|
||||||
"for backup %s" % self.id)
|
"for backup %s", self.id)
|
||||||
# swift returns etag in double quotes
|
# swift returns etag in double quotes
|
||||||
# e.g. '"dc3b0827f276d8d78312992cc60c2c3f"'
|
# e.g. '"dc3b0827f276d8d78312992cc60c2c3f"'
|
||||||
swift_checksum = resp['etag'].strip('"')
|
swift_checksum = resp['etag'].strip('"')
|
||||||
|
@ -38,7 +38,7 @@ class BackupController(wsgi.Controller):
|
|||||||
"""
|
"""
|
||||||
Return all backups information for a tenant ID.
|
Return all backups information for a tenant ID.
|
||||||
"""
|
"""
|
||||||
LOG.debug("Listing backups for tenant %s" % tenant_id)
|
LOG.debug("Listing backups for tenant %s", tenant_id)
|
||||||
datastore = req.GET.get('datastore')
|
datastore = req.GET.get('datastore')
|
||||||
context = req.environ[wsgi.CONTEXT_KEY]
|
context = req.environ[wsgi.CONTEXT_KEY]
|
||||||
policy.authorize_on_tenant(context, 'backup:index')
|
policy.authorize_on_tenant(context, 'backup:index')
|
||||||
@ -50,8 +50,8 @@ class BackupController(wsgi.Controller):
|
|||||||
|
|
||||||
def show(self, req, tenant_id, id):
|
def show(self, req, tenant_id, id):
|
||||||
"""Return a single backup."""
|
"""Return a single backup."""
|
||||||
LOG.debug("Showing a backup for tenant %s ID: '%s'"
|
LOG.debug("Showing a backup for tenant %(tenant_id)s ID: '%(id)s'",
|
||||||
% (tenant_id, id))
|
{'tenant_id': tenant_id, 'id': id})
|
||||||
context = req.environ[wsgi.CONTEXT_KEY]
|
context = req.environ[wsgi.CONTEXT_KEY]
|
||||||
backup = Backup.get_by_id(context, id)
|
backup = Backup.get_by_id(context, id)
|
||||||
policy.authorize_on_target(context, 'backup:show',
|
policy.authorize_on_target(context, 'backup:show',
|
||||||
@ -78,7 +78,7 @@ class BackupController(wsgi.Controller):
|
|||||||
|
|
||||||
def delete(self, req, tenant_id, id):
|
def delete(self, req, tenant_id, id):
|
||||||
LOG.info(_('Deleting backup for tenant %(tenant_id)s '
|
LOG.info(_('Deleting backup for tenant %(tenant_id)s '
|
||||||
'ID: %(backup_id)s') %
|
'ID: %(backup_id)s'),
|
||||||
{'tenant_id': tenant_id, 'backup_id': id})
|
{'tenant_id': tenant_id, 'backup_id': id})
|
||||||
context = req.environ[wsgi.CONTEXT_KEY]
|
context = req.environ[wsgi.CONTEXT_KEY]
|
||||||
backup = Backup.get_by_id(context, id)
|
backup = Backup.get_by_id(context, id)
|
||||||
|
Loading…
Reference in New Issue
Block a user