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: I5bcba7795894c5f4893c02d9cddb78533011ebd9
This commit is contained in:
parent
7c563db1d1
commit
05039c5dbd
|
@ -12,8 +12,6 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from muranopkgcheck.i18n import _LE
|
||||
|
||||
errors = dict()
|
||||
|
||||
|
||||
|
@ -64,7 +62,7 @@ class Report(object):
|
|||
kwargs['filename'] = filename or meta.name
|
||||
return CheckError(code=code, message=message, **kwargs)
|
||||
if code not in self.errors:
|
||||
raise ValueError(_LE('Error {} was not registered').format(code))
|
||||
raise ValueError('Error {} was not registered'.format(code))
|
||||
return _report
|
||||
|
||||
|
||||
|
@ -77,7 +75,7 @@ class Register(object):
|
|||
def __getattr__(self, code):
|
||||
code = ':'.join((self.prefix, code)) if self.prefix else code
|
||||
if code in self.errors:
|
||||
raise ValueError(_LE('Error {} is already registered')
|
||||
raise ValueError('Error {} is already registered'
|
||||
.format(code))
|
||||
|
||||
def _register(**kwargs):
|
||||
|
|
|
@ -21,13 +21,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='muranopkgcheck')
|
|||
|
||||
# The primary translation function using the well-known name "_"
|
||||
_ = _translators.primary
|
||||
|
||||
# Translators for log levels.
|
||||
#
|
||||
# The abbreviated names are meant to reflect the usual use of a short
|
||||
# name like '_'. The "L" is for "log" and the other letter comes from
|
||||
# the level.
|
||||
_LI = _translators.log_info
|
||||
_LW = _translators.log_warning
|
||||
_LE = _translators.log_error
|
||||
_LC = _translators.log_critical
|
||||
|
|
|
@ -23,7 +23,6 @@ import stevedore
|
|||
|
||||
from muranopkgcheck import error
|
||||
from muranopkgcheck.i18n import _
|
||||
from muranopkgcheck.i18n import _LE
|
||||
from muranopkgcheck import log
|
||||
from muranopkgcheck import pkg_loader
|
||||
from muranopkgcheck.validators import VALIDATORS
|
||||
|
@ -123,8 +122,8 @@ class Manager(object):
|
|||
|
||||
@staticmethod
|
||||
def failure_hook(_, ep, err):
|
||||
LOG.error(_LE('Could not load {plugin}: {error}'
|
||||
'').format(plugin=ep.name, error=err))
|
||||
LOG.error('Could not load {plugin}: {error}'
|
||||
''.format(plugin=ep.name, error=err))
|
||||
raise err
|
||||
|
||||
def validate(self, validators=None, select=None, ignore=None,
|
||||
|
|
Loading…
Reference in New Issue