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)
|
ip = socket.gethostbyname(value)
|
||||||
return ip
|
return ip
|
||||||
except socket.gaierror:
|
except socket.gaierror:
|
||||||
msg = ('Failed to resolve the hostname (%s) for node %s')
|
msg = _('Failed to resolve the hostname (%(value)s)'
|
||||||
raise utils.Error(msg % (value, node.uuid), node_info=node)
|
' for node %(uuid)s')
|
||||||
|
raise utils.Error(msg % {'value': value,
|
||||||
|
'uuid': node.uuid},
|
||||||
|
node_info=node)
|
||||||
|
|
||||||
|
|
||||||
def get_client(token=None,
|
def get_client(token=None,
|
||||||
|
@ -46,7 +46,8 @@ def _iptables(*args, **kwargs):
|
|||||||
except subprocess.CalledProcessError as exc:
|
except subprocess.CalledProcessError as exc:
|
||||||
output = exc.output.replace('\n', '. ')
|
output = exc.output.replace('\n', '. ')
|
||||||
if ignore:
|
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:
|
else:
|
||||||
LOG.error(_LE('iptables %(iptables)s failed: %(exc)s') %
|
LOG.error(_LE('iptables %(iptables)s failed: %(exc)s') %
|
||||||
{'iptables': args, 'exc': output})
|
{'iptables': args, 'exc': output})
|
||||||
|
Loading…
Reference in New Issue
Block a user