diff options
author | liu-sheng <liusheng@huawei.com> | 2014-07-09 16:12:37 +0800 |
---|---|---|
committer | liu-sheng <liusheng@huawei.com> | 2014-07-24 18:52:53 +0800 |
commit | 9c5c653ed2abfd13a41449693264a593aef10fc2 (patch) | |
tree | 55054028c2e870666c6dbf44978a7de98d444c15 /nova/api/auth.py | |
parent | c564d75719cf01dbff36956a8855ba2b4751b86e (diff) | |
download | nova-9c5c653ed2abfd13a41449693264a593aef10fc2.tar.gz |
Log translation hint for nova.api
Currently, Log translation is motivated by oslo's move to prioritized
translation of strings, as documented at
https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation
- add log translation hints for warning, error and info levels
- move from LOG.warning to LOG.warn
- remove use of % as a string formatter, use the log functionality
instead
Change-Id: I128da6cbb2be1b5b51b4a79fb38b3bf8206431d9
Diffstat (limited to 'nova/api/auth.py')
-rw-r--r-- | nova/api/auth.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nova/api/auth.py b/nova/api/auth.py index c2efb97033..710281a00d 100644 --- a/nova/api/auth.py +++ b/nova/api/auth.py @@ -22,6 +22,7 @@ import webob.exc from nova import context from nova.i18n import _ +from nova.i18n import _LW from nova.openstack.common import jsonutils from nova.openstack.common import log as logging from nova.openstack.common.middleware import request_id @@ -69,7 +70,7 @@ def pipeline_factory(loader, global_conf, **local_conf): # If the configuration file still contains 'ratelimit_v3', just ignore it. # We will remove this code at next release (J) if 'ratelimit_v3' in pipeline: - LOG.warn(_('ratelimit_v3 is removed from v3 api.')) + LOG.warn(_LW('ratelimit_v3 is removed from v3 api.')) pipeline.remove('ratelimit_v3') return _load_pipeline(loader, pipeline) @@ -156,6 +157,6 @@ class NovaKeystoneContext(wsgi.Middleware): # Fallback to deprecated role header: roles = req.headers.get('X_ROLE', '') if roles: - LOG.warn(_("Sourcing roles from deprecated X-Role HTTP " - "header")) + LOG.warn(_LW("Sourcing roles from deprecated X-Role HTTP " + "header")) return [r.strip() for r in roles.split(',')] |