Fix string interpolation at logging call

Skip creating the formatted log message
if the message is not going to be emitted
because of the log level.

TrivialFix
Change-Id: Ic35b67bc43c77a086409bed57b846f729300d5c0
This commit is contained in:
Takashi NATSUME 2016-02-18 14:09:12 +09:00
parent 4e2761d6b9
commit 18a64d3ab1

View File

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