Trivial fix translate issues

Fix some translate issues according to oslo.i18n guideline [1].

[1] http://docs.openstack.org/developer/oslo.i18n/guidelines.html

Change-Id: I93da3f1f834fb193bd2253208f689cc112baddd1
This commit is contained in:
zhongjun2 2016-12-16 09:59:55 +08:00
parent d2bdd58feb
commit a9cf8adfbf
6 changed files with 24 additions and 34 deletions

View File

@ -23,7 +23,6 @@ from oslo_config import cfg
from oslo_log import log
from oslo_utils import excutils
from oslo_utils import importutils
import six
from manila.common import constants
from manila import context
@ -189,7 +188,7 @@ class SchedulerManager(manager.Manager):
request_spec):
LOG.error(_LE("Failed to schedule %(method)s: %(ex)s"),
{"method": method, "ex": six.text_type(ex)})
{"method": method, "ex": ex})
properties = request_spec.get('share_properties', {})

View File

@ -721,9 +721,7 @@ class API(base.Base):
except Exception as e:
reservations = None
LOG.exception(
_LE("Failed to update quota for deleting share: %s"),
six.text_type(e)
)
_LE("Failed to update quota for deleting share: %s"), e)
for share_instance in share.instances:
if share_instance['host']:

View File

@ -24,7 +24,7 @@ import six
from manila.common import constants as const
from manila import exception
from manila.i18n import _, _LI, _LW
from manila.i18n import _, _LE, _LI, _LW
from manila.share.drivers.dell_emc.plugins.vnx import connector
from manila.share.drivers.dell_emc.plugins.vnx import constants
from manila.share.drivers.dell_emc.plugins.vnx import utils as vnx_utils
@ -439,13 +439,12 @@ class FileSystem(StorageObject):
try:
self._execute_cmd(copy_ckpt_cmd, check_exit_code=True)
except processutils.ProcessExecutionError as expt:
message = (_("Failed to copy content from snapshot %(snap)s to "
"file system %(filesystem)s. Reason: %(err)s.") %
{'snap': snap_name,
'filesystem': name,
'err': six.text_type(expt)})
LOG.error(message)
except processutils.ProcessExecutionError as e:
LOG.error(_LE("Failed to copy content from snapshot %(snap)s to "
"file system %(filesystem)s. Reason: %(err)s."),
{'snap': snap_name,
'filesystem': name,
'err': e})
# When an error happens during nas_copy, we need to continue
# deleting the checkpoint of the target file system if it exists.

View File

@ -452,11 +452,10 @@ class V3StorageConnection(driver.HuaweiBase):
try:
os.rmdir(item['mount_src'])
except Exception as err:
err_msg = (_('Failed to remove temp file. '
'File path: %(file_path)s. Reason: %(err)s.')
% {'file_path': item['mount_src'],
'err': six.text_type(err)})
LOG.warning(err_msg)
LOG.warning(_LW('Failed to remove temp file. File path: '
'%(file_path)s. Reason: %(err)s.'),
{'file_path': item['mount_src'],
'err': err})
return new_share_path
@ -471,7 +470,7 @@ class V3StorageConnection(driver.HuaweiBase):
LOG.error(_LE('Failed to add access to share %(name)s. '
'Reason: %(err)s.'),
{'name': old_share['name'],
'err': six.text_type(err)})
'err': err})
new_access = self.get_access(new_share)
try:
@ -482,7 +481,7 @@ class V3StorageConnection(driver.HuaweiBase):
LOG.error(_LE('Failed to mount old share %(name)s. '
'Reason: %(err)s.'),
{'name': old_share['name'],
'err': six.text_type(err)})
'err': err})
try:
self.allow_access(new_share, new_access)
@ -493,7 +492,7 @@ class V3StorageConnection(driver.HuaweiBase):
LOG.error(_LE('Failed to mount new share %(name)s. '
'Reason: %(err)s.'),
{'name': new_share['name'],
'err': six.text_type(err)})
'err': err})
copied = self.copy_snapshot_data(old_share, new_share)
@ -504,7 +503,7 @@ class V3StorageConnection(driver.HuaweiBase):
LOG.warning(_LW('Failed to unmount share %(name)s. '
'Reason: %(err)s.'),
{'name': item['name'],
'err': six.text_type(err)})
'err': err})
self.deny_access(new_share, new_access)
@ -574,9 +573,7 @@ class V3StorageConnection(driver.HuaweiBase):
if copy.get_progress()['total_progress'] == 100:
copy_finish = True
except Exception as err:
err_msg = (_("Failed to copy data, reason: %s.")
% six.text_type(err))
LOG.error(err_msg)
LOG.error(_LE("Failed to copy data, reason: %s."), err)
return copy_finish

View File

@ -325,7 +325,7 @@ class ShareManager(manager.SchedulerDependentManager):
LOG.error(
_LE("Caught exception trying ensure share '%(s_id)s'. "
"Exception: \n%(e)s."),
{'s_id': share_instance['id'], 'e': six.text_type(e)},
{'s_id': share_instance['id'], 'e': e},
)
continue
@ -344,7 +344,7 @@ class ShareManager(manager.SchedulerDependentManager):
_LE("Unexpected error occurred while updating access "
"rules for share instance %(s_id)s. "
"Exception: \n%(e)s."),
{'s_id': share_instance['id'], 'e': six.text_type(e)},
{'s_id': share_instance['id'], 'e': e},
)
self.publish_service_capabilities(ctxt)
@ -2071,8 +2071,7 @@ class ShareManager(manager.SchedulerDependentManager):
# Quota reservation errors here are not fatal, because
# unmanage is administrator API and he/she could update user
# quota usages later if it's required.
LOG.warning(_LW("Failed to update quota usages: %s."),
six.text_type(e))
LOG.warning(_LW("Failed to update quota usages: %s."), e)
if self.configuration.safe_get('unmanage_remove_access_rules'):
try:

View File

@ -88,12 +88,10 @@ def get_all_types(context, inactive=0, search_opts=None):
required_extra_specs = get_valid_required_extra_specs(
type_args['extra_specs'])
except exception.InvalidExtraSpec as e:
values = {
'share_type': type_name,
'error': six.text_type(e)
}
LOG.exception(_LE('Share type %(share_type)s has invalid required'
' extra specs: %(error)s'), values)
' extra specs: %(error)s'),
{'share_type': type_name,
'error': e})
type_args['required_extra_specs'] = required_extra_specs