from cinder.api import xmlutil
from cinder import backup as backupAPI
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder import utils
LOG.debug('delete called for member %s', id)
context = req.environ['cinder.context']
- LOG.info(_('Delete backup with id: %s'), id, context=context)
+ LOG.info(_LI('Delete backup with id: %s'), id, context=context)
try:
self.backup_api.delete(context, id)
name = backup.get('name', None)
description = backup.get('description', None)
- LOG.info(_("Creating backup of volume %(volume_id)s in container"
- " %(container)s"),
+ LOG.info(_LI("Creating backup of volume %(volume_id)s in container"
+ " %(container)s"),
{'volume_id': volume_id, 'container': container},
context=context)
restore = body['restore']
volume_id = restore.get('volume_id', None)
- LOG.info(_("Restoring backup %(backup_id)s to volume %(volume_id)s"),
+ LOG.info(_LI("Restoring backup %(backup_id)s to volume %(volume_id)s"),
{'backup_id': id, 'volume_id': volume_id},
context=context)
from cinder.api import xmlutil
from cinder import consistencygroup as consistencygroupAPI
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder import utils
LOG.debug('delete called for member %s', id)
context = req.environ['cinder.context']
- LOG.info(_('Delete cgsnapshot with id: %s'), id, context=context)
+ LOG.info(_LI('Delete cgsnapshot with id: %s'), id, context=context)
try:
cgsnapshot = self.cgsnapshot_api.get_cgsnapshot(
name = cgsnapshot.get('name', None)
description = cgsnapshot.get('description', None)
- LOG.info(_("Creating cgsnapshot %(name)s."),
+ LOG.info(_LI("Creating cgsnapshot %(name)s."),
{'name': name},
context=context)
from cinder.api import xmlutil
from cinder import consistencygroup as consistencygroupAPI
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder import utils
cg_body = body['consistencygroup']
force = cg_body.get('force', False)
- LOG.info(_('Delete consistency group with id: %s'), id,
+ LOG.info(_LI('Delete consistency group with id: %s'), id,
context=context)
try:
raise exc.HTTPBadRequest(explanation=msg)
availability_zone = consistencygroup.get('availability_zone', None)
- LOG.info(_("Creating consistency group %(name)s."),
+ LOG.info(_LI("Creating consistency group %(name)s."),
{'name': name},
context=context)
from cinder.api import xmlutil
from cinder import db
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder.openstack.common import timeutils
from cinder import utils
"""Sets the specified host's ability to accept new volumes."""
context = req.environ['cinder.context']
state = "enabled" if enabled else "disabled"
- LOG.info(_("Setting host %(host)s to %(state)s."),
+ LOG.info(_LI("Setting host %(host)s to %(state)s."),
{'host': host, 'state': state})
result = self.api.set_host_enabled(context,
host=host,
from cinder.api.views import qos_specs as view_qos_specs
from cinder.api import xmlutil
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder.openstack.common import strutils
from cinder import rpc
dom = utils.safe_minidom_parse_string(string)
key_node = self.find_first_child_named(dom, 'keys')
if not key_node:
- LOG.info(_("Unable to parse XML input."))
+ LOG.info(_LI("Unable to parse XML input."))
msg = _("Unable to parse XML request. "
"Please provide XML in correct format.")
raise webob.exc.HTTPBadRequest(explanation=msg)
from cinder.api.openstack import wsgi
from cinder.api import xmlutil
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder import replication as replicationAPI
from cinder import volume
context = req.environ['cinder.context']
try:
vol = self.volume_api.get(context, id)
- LOG.info(_('Attempting to promote secondary replica to primary'
- ' for volume %s.'),
+ LOG.info(_LI('Attempting to promote secondary replica to primary'
+ ' for volume %s.'),
str(id),
context=context)
self.replication_api.promote(context, vol)
context = req.environ['cinder.context']
try:
vol = self.volume_api.get(context, id)
- LOG.info(_('Attempting to sync secondary replica with primary'
- ' for volume %s.'),
+ LOG.info(_LI('Attempting to sync secondary replica with primary'
+ ' for volume %s.'),
str(id),
context=context)
self.replication_api.reenable(context, vol)
from cinder.api.views import transfers as transfer_view
from cinder.api import xmlutil
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder import transfer as transferAPI
from cinder import utils
name = transfer.get('name', None)
- LOG.info(_("Creating transfer of volume %s"),
+ LOG.info(_LI("Creating transfer of volume %s"),
volume_id,
context=context)
msg = _("Incorrect request body format")
raise exc.HTTPBadRequest(explanation=msg)
- LOG.info(_("Accepting transfer %s"), transfer_id,
+ LOG.info(_LI("Accepting transfer %s"), transfer_id,
context=context)
try:
"""Delete a transfer."""
context = req.environ['cinder.context']
- LOG.info(_("Delete transfer with id: %s"), id, context=context)
+ LOG.info(_LI("Delete transfer with id: %s"), id, context=context)
try:
self.transfer_api.delete(context, transfer_id=id)
from cinder.api import extensions
from cinder.api.openstack import wsgi
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder import volume
context = req.environ['cinder.context']
authorize(context)
- LOG.info(_("Unmanage volume with id: %s"), id, context=context)
+ LOG.info(_LI("Unmanage volume with id: %s"), id, context=context)
try:
vol = self.volume_api.get(context, id)
from cinder.api.openstack import wsgi
from cinder.api import xmlutil
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE, _LI
from cinder.openstack.common import importutils
from cinder.openstack.common import log as logging
import cinder.policy
"""
def __init__(self):
- LOG.info(_('Initializing extension manager.'))
+ LOG.info(_LI('Initializing extension manager.'))
self.cls_list = CONF.osapi_volume_extension
self.extensions = {}
return
alias = ext.alias
- LOG.info(_('Loaded extension: %s'), alias)
+ LOG.info(_LI('Loaded extension: %s'), alias)
if alias in self.extensions:
raise exception.Error("Found duplicate extension: %s" % alias)
LOG.debug('Ext namespace: %s', extension.namespace)
LOG.debug('Ext updated: %s', extension.updated)
except AttributeError as ex:
- LOG.exception(_("Exception loading extension: %s"), unicode(ex))
+ LOG.exception(_LE("Exception loading extension: %s"), unicode(ex))
return False
return True
from cinder.api.openstack import wsgi
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE, _LI
from cinder.openstack.common import log as logging
from cinder import utils
from cinder import wsgi as base_wsgi
def _error(self, inner, req):
if not isinstance(inner, exception.QuotaError):
- LOG.exception(_("Caught error: %s"), unicode(inner))
+ LOG.exception(_LE("Caught error: %s"), unicode(inner))
safe = getattr(inner, 'safe', False)
headers = getattr(inner, 'headers', None)
status = getattr(inner, 'code', 500)
status = 500
msg_dict = dict(url=req.url, status=status)
- LOG.info(_("%(url)s returned with HTTP %(status)d") % msg_dict)
+ LOG.info(_LI("%(url)s returned with HTTP %(status)d") % msg_dict)
outer = self.status_to_type(status)
if headers:
outer.headers = headers
import routes
from cinder.api.openstack import wsgi
-from cinder.i18n import _
+from cinder.i18n import _, _LW
from cinder.openstack.common import log as logging
from cinder import wsgi as base_wsgi
controller = extension.controller
if collection not in self.resources:
- LOG.warning(_('Extension %(ext_name)s: Cannot extend '
- 'resource %(collection)s: No such resource'),
+ LOG.warning(_LW('Extension %(ext_name)s: Cannot extend '
+ 'resource %(collection)s: No such resource'),
{'ext_name': extension.extension.name,
'collection': collection})
continue
from cinder import exception
from cinder import i18n
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import jsonutils
from cinder.openstack.common import log as logging
from cinder import utils
ex_value, exc_info=exc_info)
raise Fault(webob.exc.HTTPBadRequest())
elif isinstance(ex_value, Fault):
- LOG.info(_("Fault thrown: %s"), unicode(ex_value))
+ LOG.info(_LI("Fault thrown: %s"), unicode(ex_value))
raise ex_value
elif isinstance(ex_value, webob.exc.HTTPException):
- LOG.info(_("HTTP exception thrown: %s"), unicode(ex_value))
+ LOG.info(_LI("HTTP exception thrown: %s"), unicode(ex_value))
raise Fault(ex_value)
# We didn't handle the exception
from cinder.api.openstack import wsgi
from cinder.api import xmlutil
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder.openstack.common import strutils
from cinder import utils
"""Delete a snapshot."""
context = req.environ['cinder.context']
- LOG.info(_("Delete snapshot with id: %s"), id, context=context)
+ LOG.info(_LI("Delete snapshot with id: %s"), id, context=context)
try:
snapshot = self.volume_api.get_snapshot(context, id)
from cinder.api.openstack import wsgi
from cinder.api import xmlutil
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder.openstack.common import uuidutils
from cinder import utils
if image_id:
d['image_id'] = image_id
- LOG.info(_("vol=%s"), vol, context=context)
+ LOG.info(_LI("vol=%s"), vol, context=context)
if vol.get('volume_metadata'):
metadata = vol.get('volume_metadata')
"""Delete a volume."""
context = req.environ['cinder.context']
- LOG.info(_("Delete volume with id: %s"), id, context=context)
+ LOG.info(_LI("Delete volume with id: %s"), id, context=context)
try:
volume = self.volume_api.get(context, id)
elif size is None and kwargs['source_volume'] is not None:
size = kwargs['source_volume']['size']
- LOG.info(_("Create volume of %s GB"), size, context=context)
+ LOG.info(_LI("Create volume of %s GB"), size, context=context)
image_href = None
image_uuid = None
from cinder.api.openstack import wsgi
from cinder.api import xmlutil
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder.openstack.common import strutils
from cinder import utils
"""Delete a snapshot."""
context = req.environ['cinder.context']
- LOG.info(_("Delete snapshot with id: %s"), id, context=context)
+ LOG.info(_LI("Delete snapshot with id: %s"), id, context=context)
try:
snapshot = self.volume_api.get_snapshot(context, id)
from cinder.api import xmlutil
from cinder import consistencygroup as consistencygroupAPI
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder.openstack.common import uuidutils
from cinder import utils
"""Delete a volume."""
context = req.environ['cinder.context']
- LOG.info(_("Delete volume with id: %s"), id, context=context)
+ LOG.info(_LI("Delete volume with id: %s"), id, context=context)
try:
volume = self.volume_api.get(context, id)
elif size is None and kwargs['source_replica'] is not None:
size = kwargs['source_replica']['size']
- LOG.info(_("Create volume of %s GB"), size, context=context)
+ LOG.info(_LI("Create volume of %s GB"), size, context=context)
if self.ext_mgr.is_loaded('os-image-create'):
image_href = volume.get('imageRef')
from cinder.brick.initiator import linuxfc
from cinder.brick.initiator import linuxscsi
from cinder.brick.remotefs import remotefs
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import lockutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import loopingcall
out, info = self._execute(*cmd, run_as_root=run_as_root,
root_helper=self._root_helper)
except putils.ProcessExecutionError as e:
- LOG.error(_("Failed to access the device on the path "
- "%(path)s: %(error)s %(info)s.") %
+ LOG.error(_LE("Failed to access the device on the path "
+ "%(path)s: %(error)s %(info)s.") %
{"path": path, "error": e.stderr,
"info": info})
return False
from cinder.brick import exception
from cinder.brick import executor
-from cinder.i18n import _
+from cinder.i18n import _, _LE, _LI, _LW
from cinder.openstack.common import fileutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import processutils as putils
return backing_lun
def _recreate_backing_lun(self, iqn, tid, name, path):
- LOG.warning(_('Attempting recreate of backing lun...'))
+ LOG.warning(_LW('Attempting recreate of backing lun...'))
# Since we think the most common case of this is a dev busy
# (create vol from snapshot) we're going to add a sleep here
LOG.debug('StdOut from recreate backing lun: %s' % out)
LOG.debug('StdErr from recreate backing lun: %s' % err)
except putils.ProcessExecutionError as e:
- LOG.error(_("Failed to recover attempt to create "
- "iscsi backing lun for volume "
- "id:%(vol_id)s: %(e)s")
+ LOG.error(_LE("Failed to recover attempt to create "
+ "iscsi backing lun for volume "
+ "id:%(vol_id)s: %(e)s")
% {'vol_id': name, 'e': e})
def _get_target_chap_auth(self, name):
path, chap_str,
write_cache)
- LOG.info(_('Creating iscsi_target for: %s') % vol_id)
+ LOG.info(_LI('Creating iscsi_target for: %s') % vol_id)
volumes_dir = self.volumes_dir
volume_path = os.path.join(volumes_dir, vol_id)
run_as_root=True)
LOG.debug("Targets after update: %s" % out)
except putils.ProcessExecutionError as e:
- LOG.warning(_("Failed to create iscsi target for volume "
- "id:%(vol_id)s: %(e)s")
+ LOG.warning(_LW("Failed to create iscsi target for volume "
+ "id:%(vol_id)s: %(e)s")
% {'vol_id': vol_id, 'e': e})
#Don't forget to remove the persistent file we created
iqn = '%s%s' % (self.iscsi_target_prefix, vol_id)
tid = self._get_target(iqn)
if tid is None:
- LOG.error(_("Failed to create iscsi target for volume "
- "id:%(vol_id)s. Please ensure your tgtd config file "
- "contains 'include %(volumes_dir)s/*'") % {
- 'vol_id': vol_id,
- 'volumes_dir': volumes_dir, })
+ LOG.error(_LE("Failed to create iscsi target for volume "
+ "id:%(vol_id)s. Please ensure your tgtd config file "
+ "contains 'include %(volumes_dir)s/*'") % {
+ 'vol_id': vol_id, 'volumes_dir': volumes_dir, })
raise exception.NotFound()
# NOTE(jdg): Sometimes we have some issues with the backing lun
return tid
def remove_iscsi_target(self, tid, lun, vol_id, vol_name, **kwargs):
- LOG.info(_('Removing iscsi_target for: %s') % vol_id)
+ LOG.info(_LI('Removing iscsi_target for: %s') % vol_id)
vol_uuid_file = vol_name
volume_path = os.path.join(self.volumes_dir, vol_uuid_file)
if not os.path.exists(volume_path):
- LOG.warning(_('Volume path %s does not exist, '
- 'nothing to remove.') % volume_path)
+ LOG.warning(_LW('Volume path %s does not exist, '
+ 'nothing to remove.') % volume_path)
return
if os.path.isfile(volume_path):
run_as_root=True,
attempts=CONF.num_shell_tries)
except putils.ProcessExecutionError as e:
- LOG.error(_("Failed to remove iscsi target for volume "
- "id:%(vol_id)s: %(e)s")
+ LOG.error(_LE("Failed to remove iscsi target for volume "
+ "id:%(vol_id)s: %(e)s")
% {'vol_id': vol_id, 'e': e})
raise exception.ISCSITargetRemoveFailed(volume_id=vol_id)
# https://bugs.launchpad.net/cinder/+bug/1304122
if self._get_target(iqn):
try:
- LOG.warning(_('Silent failure of target removal '
- 'detected, retry....'))
+ LOG.warning(_LW('Silent failure of target removal '
+ 'detected, retry....'))
self._execute('tgt-admin',
'--delete',
iqn,
run_as_root=True)
except putils.ProcessExecutionError as e:
- LOG.error(_("Failed to remove iscsi target for volume "
- "id:%(vol_id)s: %(e)s")
+ LOG.error(_LE("Failed to remove iscsi target for volume "
+ "id:%(vol_id)s: %(e)s")
% {'vol_id': vol_id, 'e': e})
raise exception.ISCSITargetRemoveFailed(volume_id=vol_id)
f.close()
except putils.ProcessExecutionError as e:
vol_id = name.split(':')[1]
- LOG.error(_("Failed to create iscsi target for volume "
- "id:%(vol_id)s: %(e)s")
+ LOG.error(_LE("Failed to create iscsi target for volume "
+ "id:%(vol_id)s: %(e)s")
% {'vol_id': vol_id, 'e': e})
raise exception.ISCSITargetCreateFailed(volume_id=vol_id)
return tid
def remove_iscsi_target(self, tid, lun, vol_id, vol_name, **kwargs):
- LOG.info(_('Removing iscsi_target for volume: %s') % vol_id)
+ LOG.info(_LI('Removing iscsi_target for volume: %s') % vol_id)
self._delete_logicalunit(tid, lun, **kwargs)
self._delete_target(tid, **kwargs)
vol_uuid_file = vol_name
try:
self._execute('cinder-rtstool', 'verify')
except (OSError, putils.ProcessExecutionError):
- LOG.error(_('cinder-rtstool is not installed correctly'))
+ LOG.error(_LE('cinder-rtstool is not installed correctly'))
raise
def _get_target(self, iqn):
vol_id = name.split(':')[1]
- LOG.info(_('Creating iscsi_target for volume: %s') % vol_id)
+ LOG.info(_LI('Creating iscsi_target for volume: %s') % vol_id)
if chap_auth is not None:
(chap_auth_userid, chap_auth_password) = chap_auth.split(' ')[1:]
command_args.extend(extra_args)
self._execute(*command_args, run_as_root=True)
except putils.ProcessExecutionError as e:
- LOG.error(_("Failed to create iscsi target for volume "
- "id:%s.") % vol_id)
+ LOG.error(_LE("Failed to create iscsi target for volume "
+ "id:%s.") % vol_id)
LOG.error("%s" % e)
raise exception.ISCSITargetCreateFailed(volume_id=vol_id)
iqn = '%s%s' % (self.iscsi_target_prefix, vol_id)
tid = self._get_target(iqn)
if tid is None:
- LOG.error(_("Failed to create iscsi target for volume "
- "id:%s.") % vol_id)
+ LOG.error(_LE("Failed to create iscsi target for volume "
+ "id:%s.") % vol_id)
raise exception.NotFound()
return tid
def remove_iscsi_target(self, tid, lun, vol_id, vol_name, **kwargs):
- LOG.info(_('Removing iscsi_target: %s') % vol_id)
+ LOG.info(_LI('Removing iscsi_target: %s') % vol_id)
vol_uuid_name = vol_name
iqn = '%s%s' % (self.iscsi_target_prefix, vol_uuid_name)
iqn,
run_as_root=True)
except putils.ProcessExecutionError as e:
- LOG.error(_("Failed to remove iscsi target for volume "
- "id:%s.") % vol_id)
+ LOG.error(_LE("Failed to remove iscsi target for volume "
+ "id:%s.") % vol_id)
LOG.error("%s" % e)
raise exception.ISCSITargetRemoveFailed(volume_id=vol_id)
connector['initiator'],
run_as_root=True)
except putils.ProcessExecutionError:
- LOG.error(_("Failed to add initiator iqn %s to target.") %
+ LOG.error(_LE("Failed to add initiator iqn %s to target.") %
connector['initiator'])
raise exception.ISCSITargetAttachFailed(volume_id=volume['id'])
connector['initiator'],
run_as_root=True)
except putils.ProcessExecutionError:
- LOG.error(_("Failed to delete initiator iqn %s to target.") %
+ LOG.error(_LE("Failed to delete initiator iqn %s to target.") %
connector['initiator'])
raise exception.ISCSITargetAttachFailed(volume_id=volume['id'])
from cinder.brick import exception
from cinder.brick import executor
-from cinder.i18n import _
+from cinder.i18n import _, _LE, _LW
from cinder.openstack.common import excutils
-from cinder.openstack.common.gettextutils import _LW
from cinder.openstack.common import log as logging
from cinder.openstack.common import processutils as putils
try:
self._create_vg(physical_volumes)
except putils.ProcessExecutionError as err:
- LOG.exception(_('Error creating Volume Group'))
- LOG.error(_('Cmd :%s') % err.cmd)
- LOG.error(_('StdOut :%s') % err.stdout)
- LOG.error(_('StdErr :%s') % err.stderr)
+ LOG.exception(_LE('Error creating Volume Group'))
+ LOG.error(_LE('Cmd :%s') % err.cmd)
+ LOG.error(_LE('StdOut :%s') % err.stdout)
+ LOG.error(_LE('StdErr :%s') % err.stderr)
raise exception.VolumeGroupCreationFailed(vg_name=self.vg_name)
if self._vg_exists() is False:
free_space = pool_size - consumed_space
free_space = round(free_space, 2)
except putils.ProcessExecutionError as err:
- LOG.exception(_('Error querying thin pool about data_percent'))
- LOG.error(_('Cmd :%s') % err.cmd)
- LOG.error(_('StdOut :%s') % err.stdout)
- LOG.error(_('StdErr :%s') % err.stderr)
+ LOG.exception(_LE('Error querying thin pool about data_percent'))
+ LOG.error(_LE('Cmd :%s') % err.cmd)
+ LOG.error(_LE('StdOut :%s') % err.stdout)
+ LOG.error(_LE('StdErr :%s') % err.stderr)
return free_space
run_as_root=True)
total_time = time.time() - lvs_start
if total_time > 60:
- LOG.warning(_('Took %s seconds to get logical volumes.'),
+ LOG.warning(_LW('Took %s seconds to get logical volumes.'),
total_time)
lv_list = []
run_as_root=True)
total_time = time.time() - start_vgs
if total_time > 60:
- LOG.warning(_('Took %s seconds to get volume groups.'), total_time)
+ LOG.warning(_LW('Took %s seconds to get '
+ 'volume groups.'), total_time)
vg_list = []
if out is not None:
root_helper=self._root_helper,
run_as_root=True)
except putils.ProcessExecutionError as err:
- LOG.exception(_('Error creating Volume'))
- LOG.error(_('Cmd :%s') % err.cmd)
- LOG.error(_('StdOut :%s') % err.stdout)
- LOG.error(_('StdErr :%s') % err.stderr)
+ LOG.exception(_LE('Error creating Volume'))
+ LOG.error(_LE('Cmd :%s') % err.cmd)
+ LOG.error(_LE('StdOut :%s') % err.stdout)
+ LOG.error(_LE('StdErr :%s') % err.stderr)
raise
def create_lv_snapshot(self, name, source_lv_name, lv_type='default'):
root_helper=self._root_helper,
run_as_root=True)
except putils.ProcessExecutionError as err:
- LOG.exception(_('Error creating snapshot'))
- LOG.error(_('Cmd :%s') % err.cmd)
- LOG.error(_('StdOut :%s') % err.stdout)
- LOG.error(_('StdErr :%s') % err.stderr)
+ LOG.exception(_LE('Error creating snapshot'))
+ LOG.error(_LE('Cmd :%s') % err.cmd)
+ LOG.error(_LE('StdOut :%s') % err.stdout)
+ LOG.error(_LE('StdErr :%s') % err.stderr)
raise
def _mangle_lv_name(self, name):
root_helper=self._root_helper,
run_as_root=True)
except putils.ProcessExecutionError as err:
- LOG.exception(_('Error activating LV'))
- LOG.error(_('Cmd :%s') % err.cmd)
- LOG.error(_('StdOut :%s') % err.stdout)
- LOG.error(_('StdErr :%s') % err.stderr)
+ LOG.exception(_LE('Error activating LV'))
+ LOG.error(_LE('Cmd :%s') % err.cmd)
+ LOG.error(_LE('StdOut :%s') % err.stdout)
+ LOG.error(_LE('StdErr :%s') % err.stderr)
raise
def delete(self, name):
root_helper=self._root_helper,
run_as_root=True)
except putils.ProcessExecutionError as err:
- LOG.exception(_('Error extending Volume'))
- LOG.error(_('Cmd :%s') % err.cmd)
- LOG.error(_('StdOut :%s') % err.stdout)
- LOG.error(_('StdErr :%s') % err.stderr)
+ LOG.exception(_LE('Error extending Volume'))
+ LOG.error(_LE('Cmd :%s') % err.cmd)
+ LOG.error(_LE('StdOut :%s') % err.stdout)
+ LOG.error(_LE('StdErr :%s') % err.stderr)
raise
def vg_mirror_free_space(self, mirror_count):
root_helper=self._root_helper,
run_as_root=True)
except putils.ProcessExecutionError as err:
- LOG.exception(_('Error renaming logical volume'))
- LOG.error(_('Cmd :%s') % err.cmd)
- LOG.error(_('StdOut :%s') % err.stdout)
- LOG.error(_('StdErr :%s') % err.stderr)
+ LOG.exception(_LE('Error renaming logical volume'))
+ LOG.error(_LE('Cmd :%s') % err.cmd)
+ LOG.error(_LE('StdOut :%s') % err.stdout)
+ LOG.error(_LE('StdErr :%s') % err.stderr)
raise
import six
from cinder.brick import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder.openstack.common import processutils as putils
mount_path = self.get_mount_point(share)
if mount_path in self._read_mounts():
- LOG.info(_('Already mounted: %s') % mount_path)
+ LOG.info(_LI('Already mounted: %s') % mount_path)
return
self._execute('mkdir', '-p', mount_path, check_exit_code=0)
import six
import webob.exc
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
exc_info = sys.exc_info()
# kwargs doesn't match a variable in the message
# log the issue and the kwargs
- LOG.exception(_('Exception in string format operation'))
+ LOG.exception(_LE('Exception in string format operation'))
for name, value in kwargs.iteritems():
LOG.error("%s: %s" % (name, value))
if CONF.fatal_exception_format_errors:
from cinder import context
from cinder import db
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import importutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import timeutils
# usage resynchronization and the reservation expiration
# mechanisms will resolve the issue. The exception is
# logged, however, because this is less than optimal.
- LOG.exception(_("Failed to commit reservations %s") % reservations)
+ LOG.exception(_LE("Failed to commit "
+ "reservations %s") % reservations)
def rollback(self, context, reservations, project_id=None):
"""Roll back reservations.
# usage resynchronization and the reservation expiration
# mechanisms will resolve the issue. The exception is
# logged, however, because this is less than optimal.
- LOG.exception(_("Failed to roll back reservations "
- "%s") % reservations)
+ LOG.exception(_LE("Failed to roll back reservations "
+ "%s") % reservations)
def destroy_all_by_project(self, context, project_id):
"""Destroy all quotas, usages, and reservations associated with a
import paramiko
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
LOG = logging.getLogger(__name__)
if 'hosts_key_file' in kwargs.keys():
self.hosts_key_file = kwargs.pop('hosts_key_file')
- LOG.info(_("Secondary ssh hosts key file %(kwargs)s will be "
- "loaded along with %(conf)s from /etc/cinder.conf.") %
+ LOG.info(_LI("Secondary ssh hosts key file %(kwargs)s will be "
+ "loaded along with %(conf)s from /etc/cinder.conf.") %
{'kwargs': self.hosts_key_file,
'conf': CONF.ssh_hosts_key_file})
from oslo.config import cfg
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.image import image_utils
from cinder.openstack.common import excutils
from cinder.openstack.common import fileutils
self._is_non_recoverable(ex.stderr, non_recoverable):
raise
- LOG.exception(_("Recovering from a failed execute. "
- "Try number %s"), tries)
+ LOG.exception(_LE("Recovering from a failed execute. "
+ "Try number %s"), tries)
time.sleep(tries ** 2)
def _detach_volume(self, context, attach_info, volume, properties,
LOG.debug(("volume %s: removing export"), volume['id'])
self.remove_export(context, volume)
except Exception as ex:
- LOG.exception(_("Error detaching volume %(volume)s, "
- "due to remove export failure."),
+ LOG.exception(_LE("Error detaching volume %(volume)s, "
+ "due to remove export failure."),
{"volume": volume['id']})
raise exception.RemoveExportException(volume=volume['id'],
reason=ex)
model_update)
except exception.CinderException as ex:
if model_update:
- LOG.exception(_("Failed updating model of volume "
- "%(volume_id)s with driver provided model "
- "%(model)s") %
+ LOG.exception(_LE("Failed updating model of volume "
+ "%(volume_id)s with driver provided "
+ "model %(model)s") %
{'volume_id': volume['id'],
'model': model_update})
raise exception.ExportFailure(reason=ex)
from cinder import context
from cinder import db
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
dict(name=name,
extra_specs=extra_specs))
except db_exc.DBError as e:
- LOG.exception(_('DB error: %s') % e)
+ LOG.exception(_LE('DB error: %s') % e)
raise exception.VolumeTypeCreateFailed(name=name,
extra_specs=extra_specs)
return type_ref
import webob.exc
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE, _LI
from cinder.openstack.common import excutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import network_utils
{'host': host, 'port': port})
(self._host, self._port) = self._socket.getsockname()[0:2]
- LOG.info(_("%(name)s listening on %(_host)s:%(_port)s") %
+ LOG.info(_LI("%(name)s listening on %(_host)s:%(_port)s") %
{'name': self.name, '_host': self._host, '_port': self._port})
def start(self):
**ssl_kwargs)
except Exception:
with excutils.save_and_reraise_exception():
- LOG.error(_("Failed to start %(name)s on %(_host)s:"
- "%(_port)s with SSL support.") % self.__dict__)
+ LOG.error(_LE("Failed to start %(name)s on %(_host)s:"
+ "%(_port)s with SSL "
+ "support.") % self.__dict__)
wsgi_kwargs = {
'func': eventlet.wsgi.server,
:returns: None
"""
- LOG.info(_("Stopping WSGI server."))
+ LOG.info(_LI("Stopping WSGI server."))
if self._server is not None:
# Resize pool to stop new requests from being processed
self._pool.resize(0)
self._pool.waitall()
self._server.wait()
except greenlet.GreenletExit:
- LOG.info(_("WSGI server has stopped."))
+ LOG.info(_LI("WSGI server has stopped."))
def reset(self):
"""Reset server greenpool size to default.