diff options
author | Mike Durnosvistov <mdurnosvistov@mirantis.com> | 2014-09-19 18:32:50 +0300 |
---|---|---|
committer | Mike Durnosvistov <mdurnosvistov@mirantis.com> | 2014-11-20 11:19:16 +0200 |
commit | e8c0b822f0ef4164d3752a1d8307b55fe4183a3c (patch) | |
tree | 76db903c019721108d136060f25fe9c5245eda2f /nova/keymgr | |
parent | b7535793afb4e40d8920a85bb44a894a6c6af1c2 (diff) | |
download | nova-e8c0b822f0ef4164d3752a1d8307b55fe4183a3c.tar.gz |
Replacement `_` on `_LW` in all LOG.warning part 1
oslo.i18n uses different marker functions to separate the
translatable messages into different catalogs, which the translation
teams can prioritize translating. For details, please refer to:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html#guidelines-for-use-in-openstack
There were not marker fuctions some places in directory network.
This commit makes changes:
* Add missing marker functions
* Use ',' instead of '%' while adding variables to log messages
Added a hacking rule for the warning about checking
translation for it and checking logging level `warning` instead
alias `warn`.
Change-Id: I2bced49dc5a0408a94d5d20d85b20c682886edbe
Diffstat (limited to 'nova/keymgr')
-rw-r--r-- | nova/keymgr/mock_key_mgr.py | 6 | ||||
-rw-r--r-- | nova/keymgr/single_key_mgr.py | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/nova/keymgr/mock_key_mgr.py b/nova/keymgr/mock_key_mgr.py index af09b6877b..96b4872e8a 100644 --- a/nova/keymgr/mock_key_mgr.py +++ b/nova/keymgr/mock_key_mgr.py @@ -29,7 +29,7 @@ this class. import array from nova import exception -from nova.i18n import _ +from nova.i18n import _LW from nova.keymgr import key from nova.keymgr import key_mgr from nova.openstack.common import log as logging @@ -51,8 +51,8 @@ class MockKeyManager(key_mgr.KeyManager): """ def __init__(self): - LOG.warn(_('This key manager is not suitable for use in production' - ' deployments')) + LOG.warning(_LW('This key manager is not suitable for use in ' + 'production deployments')) self.keys = {} diff --git a/nova/keymgr/single_key_mgr.py b/nova/keymgr/single_key_mgr.py index 8e878a45b7..ca955c6dcd 100644 --- a/nova/keymgr/single_key_mgr.py +++ b/nova/keymgr/single_key_mgr.py @@ -20,7 +20,7 @@ all invocations of get_key. from nova import exception -from nova.i18n import _ +from nova.i18n import _, _LW from nova.keymgr import mock_key_mgr from nova.openstack.common import log as logging @@ -37,8 +37,8 @@ class SingleKeyManager(mock_key_mgr.MockKeyManager): """ def __init__(self): - LOG.warn(_('This key manager is insecure and is not recommended for ' - 'production deployments')) + LOG.warning(_LW('This key manager is insecure and is not recommended ' + 'for production deployments')) super(SingleKeyManager, self).__init__() self.key_id = '00000000-0000-0000-0000-000000000000' @@ -69,4 +69,4 @@ class SingleKeyManager(mock_key_mgr.MockKeyManager): raise exception.KeyManagerError( reason=_("cannot delete non-existent key")) - LOG.warn(_("Not deleting key %s"), key_id) + LOG.warning(_LW("Not deleting key %s"), key_id) |