Use international logging message

Change-Id: I8e34028f0117e85fbbdc4f5fef884e41ac57a186
This commit is contained in:
liujiong
2016-08-18 15:17:17 +08:00
parent 06066e7784
commit 084ce7c0d2
2 changed files with 14 additions and 10 deletions

View File

@@ -32,6 +32,7 @@ from keystoneclient import session
import six
from barbicanclient import client
from barbicanclient._i18n import _LW
from barbicanclient import version
@@ -340,9 +341,9 @@ class Barbican(app.App):
def main(argv=sys.argv[1:]):
logging.basicConfig()
LOG.warning("This Barbican CLI interface has been deprecated and will be "
"removed in the O release. Please use the openstack unified "
"client instead.")
LOG.warning(_LW("This Barbican CLI interface has been deprecated and "
"will be removed in the O release. Please use the "
"openstack unified client instead."))
barbican_app = Barbican()
return barbican_app.run(argv)

View File

@@ -23,6 +23,7 @@ from barbicanclient import acls as acl_manager
from barbicanclient import base
from barbicanclient import exceptions
from barbicanclient import formatter
from barbicanclient._i18n import _LW
LOG = logging.getLogger(__name__)
@@ -191,7 +192,7 @@ class Secret(SecretFormatter):
try:
self._fetch_payload()
except ValueError:
LOG.warning("Secret does not contain a payload")
LOG.warning(_LW("Secret does not contain a payload"))
return None
return self._payload
@@ -240,9 +241,10 @@ class Secret(SecretFormatter):
@immutable_after_save
def payload_content_type(self, value):
LOG.warning(
'DEPRECATION WARNING: Manually setting the payload_content_type '
'can lead to unexpected results. It will be removed in a future '
'release. See Launchpad Bug #1419166.'
_LW('DEPRECATION WARNING: Manually setting the '
'payload_content_type can lead to unexpected '
'results. It will be removed in a future release. '
'See Launchpad Bug #1419166.')
)
self._payload_content_type = value
@@ -250,9 +252,10 @@ class Secret(SecretFormatter):
@immutable_after_save
def payload_content_encoding(self, value):
LOG.warning(
'DEPRECATION WARNING: Manually setting the '
'payload_content_encoding can lead to unexpected results. It '
'will be removed in a future release. See Launchpad Bug #1419166.'
_LW('DEPRECATION WARNING: Manually setting the '
'payload_content_encoding can lead to unexpected '
'results. It will be removed in a future release. '
'See Launchpad Bug #1419166.')
)
self._payload_content_encoding = value