Fix string interpolation to delayed to be handled by the logging code

String interpolation should be delayed to be handled by the logging
code, rather than being done at the point of the logging call.
See the oslo i18n guideline.
* http://docs.openstack.org/developer/oslo.i18n/guidelines.html

Change-Id: I3fa26c1c5c672d5505fa556e03af35318f4774ab
Closes-Bug: #1596829
This commit is contained in:
haobing1 2016-07-15 17:54:30 +08:00
parent 09b51a294e
commit d2f4b63f64
1 changed files with 1 additions and 1 deletions

View File

@ -228,7 +228,7 @@ def get_api_version(version_string):
version_string = str(version_string)
if version_string in DEPRECATED_VERSIONS:
LOG.warning("Version %(deprecated_version)s is deprecated, use "
"alternative version %(alternative)s instead." %
"alternative version %(alternative)s instead.",
{"deprecated_version": version_string,
"alternative": DEPRECATED_VERSIONS[version_string]})
if strutils.is_int_like(version_string):