Merge "Add a hacking rule for string interpolation at logging"

This commit is contained in:
Jenkins 2016-10-11 17:55:32 +00:00 committed by Gerrit Code Review
commit 1301f1df30
2 changed files with 3 additions and 2 deletions

@ -64,6 +64,7 @@ Nova Specific Commandments
- [N351] Do not use the oslo_policy.policy.Enforcer.enforce() method. - [N351] Do not use the oslo_policy.policy.Enforcer.enforce() method.
- [N352] LOG.warn is deprecated. Enforce use of LOG.warning. - [N352] LOG.warn is deprecated. Enforce use of LOG.warning.
- [N353] Validate that context objects is not passed in logging calls. - [N353] Validate that context objects is not passed in logging calls.
- [N354] String interpolation should be delayed at logging calls.
Creating Unit Tests Creating Unit Tests
------------------- -------------------

@ -51,8 +51,8 @@ class AggregateImagePropertiesIsolation(filters.BaseHostFilter):
prop = image_props.get(key) prop = image_props.get(key)
except AttributeError: except AttributeError:
LOG.warning(_LW("Host '%(host)s' has a metadata key '%(key)s' " LOG.warning(_LW("Host '%(host)s' has a metadata key '%(key)s' "
"that is not present in the image metadata.") % "that is not present in the image metadata."),
{"host": host_state.host, "key": key}) {"host": host_state.host, "key": key})
continue continue
# NOTE(sbauza): Aggregate metadata is only strings, we need to # NOTE(sbauza): Aggregate metadata is only strings, we need to