Merge "remove unnecessary str method when log messages"

This commit is contained in:
Jenkins 2015-01-09 20:47:14 +00:00 committed by Gerrit Code Review
commit 26c1b4e08d
3 changed files with 4 additions and 4 deletions

View File

@ -72,7 +72,7 @@ def check_keystone(service_type=None):
keystone = _get_keystone()
if isinstance(keystone, Exception):
LOG.error(_('Skip due to keystone error %s'),
str(keystone) if keystone else '')
keystone if keystone else '')
return iter([])
elif service_type:
endpoints = keystone.service_catalog.get_endpoints(

View File

@ -99,10 +99,10 @@ class CollectorService(os_service.Service):
try:
sample = msgpack.loads(data, encoding='utf-8')
except Exception:
LOG.warn(_("UDP: Cannot decode data sent by %s"), str(source))
LOG.warn(_("UDP: Cannot decode data sent by %s"), source)
else:
try:
LOG.debug(_("UDP: Storing %s"), str(sample))
LOG.debug(_("UDP: Storing %s"), sample)
self.dispatcher_manager.map_method('record_metering_data',
sample)
except Exception:

View File

@ -93,7 +93,7 @@ class ArithmeticTransformer(transformer.TransformerBase):
)
except Exception as e:
LOG.warn(_('Unable to evaluate expression %(expr)s: %(exc)s'),
{'expr': self.expr, 'exc': str(e)})
{'expr': self.expr, 'exc': e})
def handle_sample(self, context, _sample):
self._update_cache(_sample)