Add in missing log translation hints

The patch does the following:
1. Adds in missing translations dfor log messages
2. The updated messages have dictionaries

TrivialFix

Change-Id: Id03a600694e561c4647094887fd55de127678cd1
This commit is contained in:
Gary Kotton 2016-06-20 05:23:34 -07:00
parent 6499a52e4c
commit 4e0d1e03d2
3 changed files with 16 additions and 10 deletions

View File

@ -173,9 +173,9 @@ class RequestContext(context.RequestContext):
if auth_uri: if auth_uri:
return auth_uri return auth_uri
else: else:
LOG.error('Keystone API endpoint not provided. Set ' LOG.error(_LE('Keystone API endpoint not provided. Set '
'auth_uri in section [clients_keystone] ' 'auth_uri in section [clients_keystone] '
'of the configuration file.') 'of the configuration file.'))
raise exception.AuthorizationFailure() raise exception.AuthorizationFailure()
@property @property

View File

@ -94,7 +94,8 @@ class CheckResource(object):
stack) stack)
except exception.UpdateReplace: except exception.UpdateReplace:
new_res_id = rsrc.make_replacement(tmpl.id) new_res_id = rsrc.make_replacement(tmpl.id)
LOG.info("Replacing resource with new id %s", new_res_id) LOG.info(_LI("Replacing resource with new id %s"),
new_res_id)
rpc_data = sync_point.serialize_input_data(resource_data) rpc_data = sync_point.serialize_input_data(resource_data)
self._rpc_client.check_resource(cnxt, self._rpc_client.check_resource(cnxt,
new_res_id, new_res_id,
@ -147,7 +148,8 @@ class CheckResource(object):
# if No, then latest traversal is waiting for delete. # if No, then latest traversal is waiting for delete.
if (resource_id, is_update) not in graph: if (resource_id, is_update) not in graph:
key = (resource_id, not is_update) key = (resource_id, not is_update)
LOG.info('Re-trigger resource: (%s, %s)' % (key[0], key[1])) LOG.info(_LI('Re-trigger resource: (%(key1)s, %(key2)s)'),
{'key1': key[0], 'key2': key[1]})
predecessors = set(graph[key]) predecessors = set(graph[key])
try: try:

View File

@ -16,7 +16,7 @@ import eventlet
from oslo_utils import timeutils from oslo_utils import timeutils
import six import six
from heat.common.i18n import _ from heat.common.i18n import _, _LI
from heat.engine import attributes from heat.engine import attributes
from heat.engine import constraints from heat.engine import constraints
from heat.engine import properties from heat.engine import properties
@ -161,8 +161,10 @@ class TestResource(resource.Resource):
secs = self.properties[self.ACTION_WAIT_SECS][self.action.lower()] secs = self.properties[self.ACTION_WAIT_SECS][self.action.lower()]
if secs is None: if secs is None:
secs = self.properties[self.WAIT_SECS] secs = self.properties[self.WAIT_SECS]
LOG.info('%s wait_secs:%s, action:%s' % (self.name, secs, LOG.info(_LI('%(name)s wait_secs:%(wait)s, action:%(action)s'),
self.action.lower())) {'name': self.name,
'wait': secs,
'action': self.action.lower()})
return secs return secs
def handle_create(self): def handle_create(self):
@ -226,8 +228,10 @@ class TestResource(resource.Resource):
started_at = timeutils.normalize_time(started_at) started_at = timeutils.normalize_time(started_at)
waited = timeutils.utcnow() - started_at waited = timeutils.utcnow() - started_at
LOG.info("Resource %s waited %s/%s seconds", LOG.info(_LI("Resource %(name)s waited %(waited)s/%(sec)s seconds"),
self.name, waited, wait_secs) {'name': self.name,
'waited': waited,
'sec': wait_secs})
# wait_secs < 0 is an infinite wait time. # wait_secs < 0 is an infinite wait time.
if wait_secs >= 0 and waited > datetime.timedelta(seconds=wait_secs): if wait_secs >= 0 and waited > datetime.timedelta(seconds=wait_secs):