summaryrefslogtreecommitdiff
path: root/nova/policy.py
diff options
context:
space:
mode:
authorTakashi NATSUME <natsume.takashi@lab.ntt.co.jp>2019-01-29 13:06:47 +0900
committerTakashi NATSUME <natsume.takashi@lab.ntt.co.jp>2019-01-29 15:06:39 +0900
commit552213e79f0beda26caa80d993cc4740bbad0f28 (patch)
tree0b90639745cc04ad86900998fe42e59e6831deb6 /nova/policy.py
parentc134feda3d9527dbc9735e4ae9cd35c4782f1fb4 (diff)
downloadnova-552213e79f0beda26caa80d993cc4740bbad0f28.tar.gz
Fix string interpolations in logging calls
String interpolation should be delayed to be handled by the logging code, rather than being done at the point of the logging call. * https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages The check rule for string format method will be added in openstack/hacking. TrivialFix Change-Id: I6ec56ec35bcb33d6627a47b66c4f7fc2c6f22658
Diffstat (limited to 'nova/policy.py')
-rw-r--r--nova/policy.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/policy.py b/nova/policy.py
index cfdb1097a3..5a5e9f2af8 100644
--- a/nova/policy.py
+++ b/nova/policy.py
@@ -234,10 +234,10 @@ def verify_deprecated_policy(old_policy, new_policy, default_rule, context):
current_rule = None
if current_rule != default_rule:
- LOG.warning("Start using the new action '{0}'. The existing "
- "action '{1}' is being deprecated and will be "
- "removed in future release.".format(new_policy,
- old_policy))
+ LOG.warning("Start using the new action '%(new_policy)s'. "
+ "The existing action '%(old_policy)s' is being deprecated "
+ "and will be removed in future release.",
+ {'new_policy': new_policy, 'old_policy': old_policy})
context.can(old_policy)
return True
else: