Fix formatting strings in LOG.error
Following OpenStack Style Guidelines: http://docs.openstack.org/developer/hacking/#internationalization-i18n-strings Using multiple variables for formmatting strings is not clear as using explicit dictionaries and can hide errors during refactoring. Change-Id: I5dda1f550f6369b6154403ea5257e371014de53f
This commit is contained in:
parent
3919c29a99
commit
d6eb452839
@ -147,8 +147,11 @@ def get_ipmi_address(node):
|
||||
ip = socket.gethostbyname(value)
|
||||
return ip
|
||||
except socket.gaierror:
|
||||
msg = ('Failed to resolve the hostname (%s) for node %s')
|
||||
raise utils.Error(msg % (value, node.uuid), node_info=node)
|
||||
msg = _('Failed to resolve the hostname (%(value)s)'
|
||||
' for node %(uuid)s')
|
||||
raise utils.Error(msg % {'value': value,
|
||||
'uuid': node.uuid},
|
||||
node_info=node)
|
||||
|
||||
|
||||
def get_client(token=None,
|
||||
|
@ -46,7 +46,8 @@ def _iptables(*args, **kwargs):
|
||||
except subprocess.CalledProcessError as exc:
|
||||
output = exc.output.replace('\n', '. ')
|
||||
if ignore:
|
||||
LOG.debug('Ignoring failed iptables %s: %s', args, output)
|
||||
LOG.debug('Ignoring failed iptables %(args)s: %(output)s',
|
||||
{'args': args, 'output': output})
|
||||
else:
|
||||
LOG.error(_LE('iptables %(iptables)s failed: %(exc)s') %
|
||||
{'iptables': args, 'exc': output})
|
||||
|
Loading…
Reference in New Issue
Block a user