Simplify log translations

Log messages are no longer being translated, which
can simplify logging and avoid confusion with new contributions.

OpenStack no longer supports log translation and depreciated since
Pike release.

Please refer:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Co-Authored-By: Manpreet Kaur kaurmanpreet2620@gmail.com
Change-Id: Icd3977cf87feaea3d7883d260843ec4404cd17cb
This commit is contained in:
shizhihui 2016-12-07 23:10:47 +08:00 committed by Manpreet Kaur
parent 9af55c83d1
commit 424cc36d52
5 changed files with 14 additions and 14 deletions

View File

@ -40,7 +40,7 @@ class TOSCAException(Exception):
self.message = self.msg_fmt % kwargs self.message = self.msg_fmt % kwargs
except KeyError: except KeyError:
exc_info = sys.exc_info() exc_info = sys.exc_info()
log.exception(_('Exception in string format operation: %s') log.exception('Exception in string format operation: %s'
% exc_info[1]) % exc_info[1])
if TOSCAException._FATAL_EXCEPTION_FORMAT_ERRORS: if TOSCAException._FATAL_EXCEPTION_FORMAT_ERRORS:

View File

@ -43,10 +43,10 @@ class ScalarUnit(object):
else: else:
for key in self.SCALAR_UNIT_DICT.keys(): for key in self.SCALAR_UNIT_DICT.keys():
if key.upper() == input_unit.upper(): if key.upper() == input_unit.upper():
log.warning(_('The unit "%(unit)s" does not follow ' log.warning('The unit "%(unit)s" does not follow '
'scalar unit standards; using "%(key)s" ' 'scalar unit standards; using "%(key)s" '
'instead.') % {'unit': input_unit, 'instead.' % {'unit': input_unit,
'key': key}) 'key': key})
return key return key
msg = (_('The unit "%(unit)s" is not valid. Valid units are ' msg = (_('The unit "%(unit)s" is not valid. Valid units are '
'"%(valid_units)s".') % '"%(valid_units)s".') %

View File

@ -136,7 +136,7 @@ class ImportsLoader(object):
def _validate_import_keys(self, import_name, import_uri_def): def _validate_import_keys(self, import_name, import_uri_def):
if self.FILE not in import_uri_def.keys(): if self.FILE not in import_uri_def.keys():
log.warning(_('Missing keyname "file" in import "%(name)s".') log.warning('Missing keyname "file" in import "%(name)s".'
% {'name': import_name}) % {'name': import_name})
ExceptionCollector.appendException( ExceptionCollector.appendException(
MissingRequiredFieldError( MissingRequiredFieldError(
@ -144,8 +144,8 @@ class ImportsLoader(object):
required=self.FILE)) required=self.FILE))
for key in import_uri_def.keys(): for key in import_uri_def.keys():
if key not in self.IMPORTS_SECTION: if key not in self.IMPORTS_SECTION:
log.warning(_('Unknown keyname "%(key)s" error in ' log.warning('Unknown keyname "%(key)s" error in '
'imported definition "%(def)s".') 'imported definition "%(def)s".'
% {'key': key, 'def': import_name}) % {'key': key, 'def': import_name})
ExceptionCollector.appendException( ExceptionCollector.appendException(
UnknownFieldError( UnknownFieldError(
@ -255,7 +255,7 @@ class ImportsLoader(object):
return None, None return None, None
if not import_template: if not import_template:
log.error(_('Import "%(name)s" is not valid.') % log.error('Import "%(name)s" is not valid.' %
{'name': import_uri_def}) {'name': import_uri_def})
ExceptionCollector.appendException( ExceptionCollector.appendException(
ImportError(_('Import "%s" is not valid.') % ImportError(_('Import "%s" is not valid.') %
@ -264,7 +264,7 @@ class ImportsLoader(object):
return import_template, YAML_LOADER(import_template, a_file) return import_template, YAML_LOADER(import_template, a_file)
if short_import_notation: if short_import_notation:
log.error(_('Import "%(name)s" is not valid.') % import_uri_def) log.error('Import "%(name)s" is not valid.' % import_uri_def)
ExceptionCollector.appendException( ExceptionCollector.appendException(
ImportError(_('Import "%s" is not valid.') % import_uri_def)) ImportError(_('Import "%s" is not valid.') % import_uri_def))
return None, None return None, None

View File

@ -76,8 +76,8 @@ class TopologyTemplate(object):
if (self.parsed_params and input.name not in self.parsed_params if (self.parsed_params and input.name not in self.parsed_params
or self.parsed_params is None) and input.required \ or self.parsed_params is None) and input.required \
and input.default is None: and input.default is None:
log.warning(_('The required parameter %s ' log.warning('The required parameter %s '
'is not provided') % input.name) 'is not provided' % input.name)
inputs.append(input) inputs.append(input)
return inputs return inputs

View File

@ -179,7 +179,7 @@ class TOSCAVersionProperty(object):
return return
ver = match.groupdict() ver = match.groupdict()
if self.version in ['0', '0.0', '0.0.0']: if self.version in ['0', '0.0', '0.0.0']:
log.warning(_('Version assumed as not provided')) log.warning('Version assumed as not provided')
self.version = None self.version = None
self.minor_version = ver['minor_version'] self.minor_version = ver['minor_version']
self.major_version = ver['major_version'] self.major_version = ver['major_version']
@ -198,7 +198,7 @@ class TOSCAVersionProperty(object):
if self.minor_version is None and self.build_version is None and \ if self.minor_version is None and self.build_version is None and \
value != '0': value != '0':
log.warning(_('Minor version assumed "0".')) log.warning('Minor version assumed "0".')
self.version = '.'.join([value, '0']) self.version = '.'.join([value, '0'])
return value return value