Browse Source

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
Xianghui Zeng 2 years ago
parent
commit
05039c5dbd
3 changed files with 4 additions and 17 deletions
  1. 2
    4
      muranopkgcheck/error.py
  2. 0
    10
      muranopkgcheck/i18n.py
  3. 2
    3
      muranopkgcheck/manager.py

+ 2
- 4
muranopkgcheck/error.py View File

@@ -12,8 +12,6 @@
12 12
 #    License for the specific language governing permissions and limitations
13 13
 #    under the License.
14 14
 
15
-from muranopkgcheck.i18n import _LE
16
-
17 15
 errors = dict()
18 16
 
19 17
 
@@ -64,7 +62,7 @@ class Report(object):
64 62
                 kwargs['filename'] = filename or meta.name
65 63
             return CheckError(code=code, message=message, **kwargs)
66 64
         if code not in self.errors:
67
-            raise ValueError(_LE('Error {} was not registered').format(code))
65
+            raise ValueError('Error {} was not registered'.format(code))
68 66
         return _report
69 67
 
70 68
 
@@ -77,7 +75,7 @@ class Register(object):
77 75
     def __getattr__(self, code):
78 76
         code = ':'.join((self.prefix, code)) if self.prefix else code
79 77
         if code in self.errors:
80
-            raise ValueError(_LE('Error {} is already registered')
78
+            raise ValueError('Error {} is already registered'
81 79
                              .format(code))
82 80
 
83 81
         def _register(**kwargs):

+ 0
- 10
muranopkgcheck/i18n.py View File

@@ -21,13 +21,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='muranopkgcheck')
21 21
 
22 22
 # The primary translation function using the well-known name "_"
23 23
 _ = _translators.primary
24
-
25
-# Translators for log levels.
26
-#
27
-# The abbreviated names are meant to reflect the usual use of a short
28
-# name like '_'. The "L" is for "log" and the other letter comes from
29
-# the level.
30
-_LI = _translators.log_info
31
-_LW = _translators.log_warning
32
-_LE = _translators.log_error
33
-_LC = _translators.log_critical

+ 2
- 3
muranopkgcheck/manager.py View File

@@ -23,7 +23,6 @@ import stevedore
23 23
 
24 24
 from muranopkgcheck import error
25 25
 from muranopkgcheck.i18n import _
26
-from muranopkgcheck.i18n import _LE
27 26
 from muranopkgcheck import log
28 27
 from muranopkgcheck import pkg_loader
29 28
 from muranopkgcheck.validators import VALIDATORS
@@ -123,8 +122,8 @@ class Manager(object):
123 122
 
124 123
     @staticmethod
125 124
     def failure_hook(_, ep, err):
126
-        LOG.error(_LE('Could not load {plugin}: {error}'
127
-                      '').format(plugin=ep.name, error=err))
125
+        LOG.error('Could not load {plugin}: {error}'
126
+                  ''.format(plugin=ep.name, error=err))
128 127
         raise err
129 128
 
130 129
     def validate(self, validators=None, select=None, ignore=None,

Loading…
Cancel
Save