Merge "Add log translation marker"

This commit is contained in:
Jenkins 2016-12-13 03:19:51 +00:00 committed by Gerrit Code Review
commit 3d7159ec6d
4 changed files with 19 additions and 13 deletions

View File

@ -21,7 +21,7 @@ import six
import tenacity
from webob import response
from murano.common.i18n import _LI, _LW
from murano.common.i18n import _LI, _LW, _LE
from murano.common import auth_utils # noqa
from murano.common import wsgi
from murano.db.services import cf_connections as db_cf
@ -304,8 +304,9 @@ def _get_muranoclient(token_id, req):
murano_url = CONF.murano.url or req.endpoints.get('murano')
if not murano_url:
LOG.error('No murano url is specified and no "application-catalog" '
'service is registered in keystone.')
LOG.error(_LE('No murano url is specified and no '
'"application-catalog" '
'service is registered in keystone.'))
return muranoclient.Client(1, murano_url, token=token_id,
artifacts_client=artifacts_client)
@ -316,8 +317,8 @@ def _get_glareclient(token_id, req):
url = glare_settings.url or req.endpoints.get('glare')
if not url:
LOG.error('No glare url is specified and no "artifact" '
'service is registered in keystone.')
LOG.error(_LE('No glare url is specified and no "artifact" '
'service is registered in keystone.'))
return glare_client.Client(
endpoint=url, token=token_id,

View File

@ -18,7 +18,7 @@ from oslo_config import cfg
from oslo_log import log as logging
from stevedore import dispatch
from murano.common.i18n import _LE, _LW
from murano.common.i18n import _LE, _LW, _LI
CONF = cfg.CONF
@ -28,7 +28,7 @@ NAMESPACE = 'io.murano.plugins.packages'
class PluginLoader(object):
def __init__(self):
LOG.info('Loading package type plugins')
LOG.info(_LI('Loading package type plugins'))
extension_manager = dispatch.EnabledExtensionManager(
NAMESPACE,
self._is_plugin_enabled,
@ -75,7 +75,7 @@ class PluginLoader(object):
else:
self._initialize_plugin(package_class)
self.formats.setdefault(name, {})[version] = package_class
LOG.info('Plugin for "{0}" package type was loaded'.format(
LOG.info(_LI('Plugin for "{0}" package type was loaded').format(
format_name))
def get_package_handler(self, format_name):

View File

@ -32,6 +32,8 @@ from murano.dsl import virtual_exceptions
from murano.dsl import yaql_integration
from murano.common.i18n import _LW
LOG = logging.getLogger(__name__)
macros.register()
virtual_exceptions.register()
@ -137,8 +139,8 @@ class MuranoMethod(dsl_types.MuranoMethod, meta.MetaProvider):
if self._usage == dsl_types.MethodUsages.Action:
runtime_version = self.declaring_type.package.runtime_version
if runtime_version > constants.RUNTIME_VERSION_1_3:
LOG.warning('"Usage: Action" is deprecated, '
'use "Scope: Public" instead')
LOG.warning(_LW('"Usage: Action" is deprecated, '
'use "Scope: Public" instead'))
if self._scope == dsl_types.MethodScopes.Session:
raise ValueError(
'Both "Usage: Action" and "Scope: Session" are '

View File

@ -31,10 +31,12 @@ from muranoclient.glance import client as glare_client
from oslo_log import log as logging
import yaml
from murano.common.i18n import _LW, _LE
from murano.services import states
import murano.tests.functional.common.zip_utils_mixin as zip_utils
import murano.tests.functional.engine.config as cfg
CONF = cfg.cfg.CONF
LOG = logging.getLogger(__name__)
@ -201,7 +203,7 @@ class DeployTestMixin(zip_utils.ZipUtilsMixin):
deployment = cls.get_last_deployment(environment)
try:
details = deployment.result['result']['details']
LOG.warning('Details:\n {details}'.format(details=details))
LOG.warning(_LW('Details:\n {details}').format(details=details))
except Exception as e:
LOG.error(e)
report = cls.get_deployment_report(environment, deployment)
@ -335,7 +337,8 @@ class DeployTestMixin(zip_utils.ZipUtilsMixin):
service_type='application-catalog', endpoint_type='publicURL')
except ks_exceptions.EndpointNotFound:
url = CONF.murano.murano_url
LOG.warning("Murano endpoint not found in Keystone. Using CONF.")
LOG.warning(_LW("Murano endpoint not found in Keystone. "
"Using CONF."))
return url if 'v1' not in url else "/".join(
url.split('/')[:url.split('/').index('v1')])
@ -359,7 +362,7 @@ class DeployTestMixin(zip_utils.ZipUtilsMixin):
raise RuntimeError('Resource at {0}:{1} not exist'.
format(ip, port))
except socket.error as e:
LOG.error('Socket Error: {error}'.format(error=e))
LOG.error(_LE('Socket Error: {error}').format(error=e))
@classmethod
def get_ip_by_appname(cls, environment, appname):