Fix string formatting in example

According to oslo.i18n guidelines % operator shouldn't be used for
log messages formatting. Translations should be formatted by passing
variable (or variables) as second parameter of LOG method.

Change-Id: I93e5348d469d125383f831841845ec23a8bf59a1
Closes-Bug: 1437211
This commit is contained in:
Michal Dulko
2015-03-27 09:54:06 +01:00
parent 8d5dedc944
commit 3e3322d9f0

View File

@@ -198,8 +198,8 @@ Example::
Example::
msg = _LE("Missing parameter: %s") % ("flavor")
LOG.error(msg)
msg = _LE("Missing parameter: %s")
LOG.error(msg, "flavor")
- [H703] If you have multiple variables to place in the string, use keyword
parameters. This helps our translators reorder parameters when needed.
@@ -207,7 +207,7 @@ Example::
Example::
msg = _LE("The server with id %(s_id)s has no key %(m_key)s")
LOG.error(msg % {"s_id": "1234", "m_key": "imageId"})
LOG.error(msg, {"s_id": "1234", "m_key": "imageId"})
.. seealso::