Remove log translations
Log messages are no longer being translated. This removes all use of the _LE, _LI, and _LW translation markers to simplify logging and to avoid confusion with new contributions. See: http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html Change-Id: I471d79a86d88e98688246ffbdc29fb579f5fd52a
This commit is contained in:
parent
cd8b248a70
commit
eddc07c58b
|
@ -23,7 +23,7 @@ import yaml
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from ceilometer.i18n import _LE, _LW
|
||||
|
||||
from ceilometer import sample
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
@ -59,12 +59,12 @@ class CeilometerStaticMappingDefinition(object):
|
|||
if not self.cfg.get(field)]
|
||||
if missing:
|
||||
raise CeilometerStaticMappingDefinitionException(
|
||||
_LE("Required fields %s not specified") % missing, self.cfg)
|
||||
"Required fields %s not specified" % missing, self.cfg)
|
||||
|
||||
if ('type' not in self.cfg.get('lookup', []) and
|
||||
self.cfg['type'] not in sample.TYPES):
|
||||
raise CeilometerStaticMappingDefinitionException(
|
||||
_LE("Invalid type %s specified") % self.cfg['type'], self.cfg)
|
||||
"Invalid type %s specified" % self.cfg['type'], self.cfg)
|
||||
|
||||
|
||||
def get_config_file():
|
||||
|
@ -92,15 +92,15 @@ def setup_ceilometer_static_mapping_config():
|
|||
except yaml.YAMLError as err:
|
||||
if hasattr(err, 'problem_mark'):
|
||||
mark = err.problem_mark
|
||||
errmsg = (_LE("Invalid YAML syntax in static Ceilometer "
|
||||
"Mapping Definitions file %(file)s at line: "
|
||||
"%(line)s, column: %(column)s.")
|
||||
errmsg = ("Invalid YAML syntax in static Ceilometer "
|
||||
"Mapping Definitions file %(file)s at line: "
|
||||
"%(line)s, column: %(column)s."
|
||||
% dict(file=config_file,
|
||||
line=mark.line + 1,
|
||||
column=mark.column + 1))
|
||||
else:
|
||||
errmsg = (_LE("YAML error reading static Ceilometer Mapping "
|
||||
"Definitions file %(file)s") %
|
||||
errmsg = ("YAML error reading static Ceilometer Mapping "
|
||||
"Definitions file %(file)s" %
|
||||
dict(file=config_file))
|
||||
|
||||
LOG.error(errmsg)
|
||||
|
@ -124,16 +124,16 @@ def load_definitions(config_def):
|
|||
for meter_info_static_map in reversed(config_def['meter_info_static_map']):
|
||||
if meter_info_static_map.get('name') in ceilometer_static_mapping_defs:
|
||||
# skip duplicate meters
|
||||
LOG.warning(_LW("Skipping duplicate Ceilometer Monasca Mapping"
|
||||
" Definition %s") % meter_info_static_map)
|
||||
LOG.warning("Skipping duplicate Ceilometer Monasca Mapping"
|
||||
" Definition %s" % meter_info_static_map)
|
||||
continue
|
||||
|
||||
try:
|
||||
md = CeilometerStaticMappingDefinition(meter_info_static_map)
|
||||
ceilometer_static_mapping_defs[meter_info_static_map['name']] = md
|
||||
except CeilometerStaticMappingDefinitionException as me:
|
||||
errmsg = (_LE("Error loading Ceilometer Static Mapping "
|
||||
"Definition : %(err)s") % dict(err=me.message))
|
||||
errmsg = ("Error loading Ceilometer Static Mapping "
|
||||
"Definition : %(err)s" % dict(err=me.message))
|
||||
LOG.error(errmsg)
|
||||
return ceilometer_static_mapping_defs.values()
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ from jsonpath_rw_ext import parser
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from ceilometer.i18n import _LE, _LW
|
||||
|
||||
from ceilometer import pipeline
|
||||
from ceilometer import sample
|
||||
|
||||
|
@ -66,7 +66,7 @@ class CeiloscaMappingDefinition(object):
|
|||
if not self.cfg.get(field)]
|
||||
if missing:
|
||||
raise CeiloscaMappingDefinitionException(
|
||||
_LE("Required fields %s not specified") % missing, self.cfg)
|
||||
"Required fields %s not specified" % missing, self.cfg)
|
||||
|
||||
self._monasca_metric_name = self.cfg.get('monasca_metric_name')
|
||||
if isinstance(self._monasca_metric_name, six.string_types):
|
||||
|
@ -75,7 +75,7 @@ class CeiloscaMappingDefinition(object):
|
|||
if ('type' not in self.cfg.get('lookup', []) and
|
||||
self.cfg['type'] not in sample.TYPES):
|
||||
raise CeiloscaMappingDefinitionException(
|
||||
_LE("Invalid type %s specified") % self.cfg['type'], self.cfg)
|
||||
"Invalid type %s specified" % self.cfg['type'], self.cfg)
|
||||
|
||||
self._field_getter = {}
|
||||
for name, field in self.cfg.items():
|
||||
|
@ -102,9 +102,9 @@ class CeiloscaMappingDefinition(object):
|
|||
try:
|
||||
parts = self.JSONPATH_RW_PARSER.parse(field)
|
||||
except Exception as e:
|
||||
raise CeiloscaMappingDefinitionException(_LE(
|
||||
raise CeiloscaMappingDefinitionException(
|
||||
"Parse error in JSONPath specification "
|
||||
"'%(jsonpath)s': %(err)s")
|
||||
"'%(jsonpath)s': %(err)s"
|
||||
% dict(jsonpath=field, err=e), self.cfg)
|
||||
return parts
|
||||
|
||||
|
@ -157,15 +157,15 @@ def setup_ceilosca_mapping_config():
|
|||
except yaml.YAMLError as err:
|
||||
if hasattr(err, 'problem_mark'):
|
||||
mark = err.problem_mark
|
||||
errmsg = (_LE("Invalid YAML syntax in Ceilometer Monasca "
|
||||
"Mapping Definitions file %(file)s at line: "
|
||||
"%(line)s, column: %(column)s.")
|
||||
errmsg = ("Invalid YAML syntax in Ceilometer Monasca "
|
||||
"Mapping Definitions file %(file)s at line: "
|
||||
"%(line)s, column: %(column)s."
|
||||
% dict(file=config_file,
|
||||
line=mark.line + 1,
|
||||
column=mark.column + 1))
|
||||
else:
|
||||
errmsg = (_LE("YAML error reading Ceilometer Monasca Mapping "
|
||||
"Definitions file %(file)s") %
|
||||
errmsg = ("YAML error reading Ceilometer Monasca Mapping "
|
||||
"Definitions file %(file)s" %
|
||||
dict(file=config_file))
|
||||
|
||||
LOG.error(errmsg)
|
||||
|
@ -189,16 +189,16 @@ def load_definitions(config_def):
|
|||
for meter_metric_map in reversed(config_def['meter_metric_map']):
|
||||
if meter_metric_map.get('name') in ceilosca_mapping_defs:
|
||||
# skip duplicate meters
|
||||
LOG.warning(_LW("Skipping duplicate Ceilometer Monasca Mapping"
|
||||
" Definition %s") % meter_metric_map)
|
||||
LOG.warning("Skipping duplicate Ceilometer Monasca Mapping"
|
||||
" Definition %s" % meter_metric_map)
|
||||
continue
|
||||
|
||||
try:
|
||||
md = CeiloscaMappingDefinition(meter_metric_map)
|
||||
ceilosca_mapping_defs[meter_metric_map['name']] = md
|
||||
except CeiloscaMappingDefinitionException as me:
|
||||
errmsg = (_LE("Error loading Ceilometer Monasca Mapping "
|
||||
"Definition : %(err)s") % dict(err=me.message))
|
||||
errmsg = ("Error loading Ceilometer Monasca Mapping "
|
||||
"Definition : %(err)s" % dict(err=me.message))
|
||||
LOG.error(errmsg)
|
||||
return ceilosca_mapping_defs.values()
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from oslo_config import cfg
|
|||
from oslo_log import log
|
||||
import retrying
|
||||
|
||||
from ceilometer.i18n import _, _LW
|
||||
from ceilometer.i18n import _
|
||||
from ceilometer import keystone_client
|
||||
|
||||
|
||||
|
@ -78,7 +78,7 @@ class Client(object):
|
|||
# NOTE(zqfan): There are many concurrency requests while using
|
||||
# Ceilosca, to save system resource, we don't retry too many times.
|
||||
if self._max_retries < 0 or self._max_retries > 10:
|
||||
LOG.warning(_LW('Reduce max retries from %s to 10'),
|
||||
LOG.warning('Reduce max retries from %s to 10',
|
||||
self._max_retries)
|
||||
self._max_retries = 10
|
||||
conf = cfg.CONF.service_credentials
|
||||
|
|
|
@ -19,7 +19,7 @@ from oslo_log import log
|
|||
from oslo_utils import timeutils
|
||||
import yaml
|
||||
|
||||
from ceilometer.i18n import _LI
|
||||
|
||||
from ceilometer import sample as sample_util
|
||||
|
||||
OPTS = [
|
||||
|
@ -170,9 +170,9 @@ class MonascaDataFilter(object):
|
|||
value_meta=value_meta,
|
||||
)
|
||||
|
||||
LOG.debug(_LI("Generated metric with name %(name)s,"
|
||||
" timestamp %(timestamp)s, value %(value)s,"
|
||||
" dimensions %(dimensions)s") %
|
||||
LOG.debug("Generated metric with name %(name)s,"
|
||||
" timestamp %(timestamp)s, value %(value)s,"
|
||||
" dimensions %(dimensions)s" %
|
||||
{'name': metric['name'],
|
||||
'timestamp': metric['timestamp'],
|
||||
'value': metric['value'],
|
||||
|
|
Loading…
Reference in New Issue