Add a hacking rule for string interpolation at logging
String interpolation should be delayed to be handled by the logging code, rather than being done at the point of the logging call. So add the following hacking rule for it. - [N354] String interpolation should be delayed at logging calls. See the oslo i18n guideline. * http://docs.openstack.org/developer/oslo.i18n/guidelines.html Change-Id: Ief6d3ee3539c0857098fffdb7acfeec3e0fed6eb Closes-Bug: #1596829
This commit is contained in:
parent
a57b8438ff
commit
5bcab383ba
@ -64,6 +64,7 @@ Nova Specific Commandments
|
||||
- [N351] Do not use the oslo_policy.policy.Enforcer.enforce() method.
|
||||
- [N352] LOG.warn is deprecated. Enforce use of LOG.warning.
|
||||
- [N353] Validate that context objects is not passed in logging calls.
|
||||
- [N354] String interpolation should be delayed at logging calls.
|
||||
|
||||
Creating Unit Tests
|
||||
-------------------
|
||||
|
@ -51,8 +51,8 @@ class AggregateImagePropertiesIsolation(filters.BaseHostFilter):
|
||||
prop = image_props.get(key)
|
||||
except AttributeError:
|
||||
LOG.warning(_LW("Host '%(host)s' has a metadata key '%(key)s' "
|
||||
"that is not present in the image metadata.") %
|
||||
{"host": host_state.host, "key": key})
|
||||
"that is not present in the image metadata."),
|
||||
{"host": host_state.host, "key": key})
|
||||
continue
|
||||
|
||||
# NOTE(sbauza): Aggregate metadata is only strings, we need to
|
||||
|
Loading…
x
Reference in New Issue
Block a user