from cinder.db import base
from cinder import exception
from cinder import flow_utils
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.image import glance
from cinder import keymgr
from cinder.openstack.common import log as logging
availability_zones,
create_what)
except Exception:
- LOG.exception(_("Failed to create api volume flow"))
+ LOG.exception(_LE("Failed to create api volume flow"))
raise exception.CinderException(
_("Failed to create api volume flow"))
**reserve_opts)
except Exception:
reservations = None
- LOG.exception(_("Failed to update quota for deleting volume"))
+ LOG.exception(_LE("Failed to update quota for "
+ "deleting volume"))
self.db.volume_destroy(context.elevated(), volume_id)
if reservations:
from cinder.db.sqlalchemy import api
from cinder.db.sqlalchemy import models
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
from cinder import utils
from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib
total_gb, free_gb = self.command.comm_get_dp_pool(
self.configuration.hitachi_pool_id)
except Exception as ex:
- LOG.error(_('Failed to update volume status: %s') %
+ LOG.error(_LE('Failed to update volume status: %s') %
six.text_type(ex))
return None
import six
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
from cinder.openstack.common import loopingcall
from cinder import utils
raise loopingcall.LoopingCallDone()
if self.shutdown_horcm(inst):
- LOG.error(_("Failed to shutdown horcm."))
+ LOG.error(_LE("Failed to shutdown horcm."))
raise loopingcall.LoopingCallDone()
@horcm_synchronized
raise loopingcall.LoopingCallDone((ret, stdout, stderr))
if time.time() - start >= EXEC_MAX_WAITTIME:
- LOG.error(_("horcm command timeout."))
+ LOG.error(_LE("horcm command timeout."))
raise loopingcall.LoopingCallDone((ret, stdout, stderr))
if (ret == EX_ENAUTH and
not re.search("-login %s %s" % (user, passwd), args)):
_ret, _stdout, _stderr = self.comm_login()
if _ret:
- LOG.error(_("Failed to authenticate user."))
+ LOG.error(_LE("Failed to authenticate user."))
raise loopingcall.LoopingCallDone((ret, stdout, stderr))
elif ret in HORCM_ERROR:
if self.check_horcm(inst) != HORCM_RUNNING:
_ret, _stdout, _stderr = self.start_horcm(inst)
if _ret and _ret != HORCM_RUNNING:
- LOG.error(_("Failed to start horcm."))
+ LOG.error(_LE("Failed to start horcm."))
raise loopingcall.LoopingCallDone((ret, stdout, stderr))
elif ret not in COMMAND_IO_TO_RAID:
- LOG.error(_("Unexpected error occurs in horcm."))
+ LOG.error(_LE("Unexpected error occurs in horcm."))
raise loopingcall.LoopingCallDone((ret, stdout, stderr))
def exec_raidcom(self, cmd, args, printflag=True):
import six
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _LE
from cinder.openstack.common import log as logging
from cinder import utils
import cinder.volume.driver
% {'port': port, 'gid': gid})
break
if gid is None:
- LOG.error(_('Failed to add target(port: %s)') % port)
+ LOG.error(_LE('Failed to add target(port: %s)') % port)
continue
try:
if added_hostgroup:
import six
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
from cinder.openstack.common import loopingcall
from cinder import utils
raise loopingcall.LoopingCallDone((ret, stdout, stderr))
if time.time() - start >= timeout:
- LOG.error(_("snm2 command timeout."))
+ LOG.error(_LE("snm2 command timeout."))
raise loopingcall.LoopingCallDone((ret, stdout, stderr))
if (re.search('DMEC002047', stderr)
or re.search('DMER0800CF', stderr)
or re.search('DMER0800D[0-6D]', stderr)
or re.search('DMES052602', stderr)):
- LOG.error(_("Unexpected error occurs in snm2."))
+ LOG.error(_LE("Unexpected error occurs in snm2."))
raise loopingcall.LoopingCallDone((ret, stdout, stderr))
def exec_hsnm(self, command, args, printflag=True, noretry=False,
from xml.etree import ElementTree as ET
-from cinder.i18n import _
+from cinder.i18n import _LE
from cinder.openstack.common import log as logging
LOG = logging.getLogger(__name__)
root = tree.getroot()
return root
except IOError as err:
- LOG.error(_('parse_xml_file: %s') % err)
+ LOG.error(_LE('parse_xml_file: %s') % err)
raise err
from cinder import context
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
from cinder import utils
from cinder.volume.drivers.huawei import huawei_utils
try:
res_json = json.loads(res)
except Exception as err:
- LOG.error(_('JSON transfer error'))
+ LOG.error(_LE('JSON transfer error'))
raise err
return res_json
from cinder import context
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 ssh_utils
from cinder import utils
try:
tree.write(filename, 'UTF-8')
except Exception as err:
- LOG.info(_('_get_login_info: %s') % err)
+ LOG.info(_LI('_get_login_info: %s') % err)
return logininfo
self.ssh_pool.ip = ip1
old_ip = ip0
- LOG.info(_('_execute_cli: Can not connect to IP '
- '%(old)s, try to connect to the other '
- 'IP %(new)s.')
+ LOG.info(_LI('_execute_cli: Can not connect to IP '
+ '%(old)s, try to connect to the other '
+ 'IP %(new)s.')
% {'old': old_ip, 'new': self.ssh_pool.ip})
if not ssh_client:
else:
if ssh_client:
self.ssh_pool.remove(ssh_client)
- LOG.error(_('_execute_cli: %s') % err)
+ LOG.error(_LE('_execute_cli: %s') % err)
raise err
def _reset_transport_timeout(self, ssh, time):
"""Map a volume to a host."""
# Map a LUN to a host if not mapped.
if not self._check_volume_created(volume_id):
- LOG.error(_('map_volume: Volume %s was not found.') % volume_id)
+ LOG.error(_LE('map_volume: Volume %s was not found.') % volume_id)
raise exception.VolumeNotFound(volume_id=volume_id)
hostlun_id = None
host_name = HOST_NAME_PREFIX + host_name
host_id = self._get_host_id(host_name, self.hostgroup_id)
if host_id is None:
- LOG.error(_('remove_map: Host %s does not exist.') % host_name)
+ LOG.error(_LE('remove_map: Host %s does '
+ 'not exist.') % host_name)
raise exception.HostNotFound(host=host_name)
if not self._check_volume_created(volume_id):
- LOG.error(_('remove_map: Volume %s does not exist.') % volume_id)
+ LOG.error(_LE('remove_map: Volume %s does not exist.') % volume_id)
raise exception.VolumeNotFound(volume_id=volume_id)
map_id = None
elif re.search('Dorado5100$', line):
return 'Dorado5100'
else:
- LOG.error(_('_get_device_type: The driver only supports '
- 'Dorado5100 and Dorado 2100 G2 now.'))
+ LOG.error(_LE('_get_device_type: The driver only supports '
+ 'Dorado5100 and Dorado 2100 G2 now.'))
raise exception.InvalidResults()
def _get_lun_distribution_info(self, luns):
from oslo.utils import units
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.image import image_utils
from cinder.openstack.common import fileutils
from cinder.openstack.common import log as logging
(out, err) = self._execute('mmgetstate', '-Y', run_as_root=True)
return out
except processutils.ProcessExecutionError as exc:
- LOG.error(_('Failed to issue mmgetstate command, error: %s.') %
+ LOG.error(_LE('Failed to issue mmgetstate command, error: %s.') %
exc.stderr)
raise exception.VolumeBackendAPIException(data=exc.stderr)
state_token = lines[0].split(':').index('state')
gpfs_state = lines[1].split(':')[state_token]
if gpfs_state != 'active':
- LOG.error(_('GPFS is not active. Detailed output: %s.') % out)
+ LOG.error(_LE('GPFS is not active. Detailed output: %s.') % out)
exception_message = (_('GPFS is not running, state: %s.') %
gpfs_state)
raise exception.VolumeBackendAPIException(data=exception_message)
filesystem = lines[1].split()[0]
return filesystem
except processutils.ProcessExecutionError as exc:
- LOG.error(_('Failed to issue df command for path %(path)s, '
- 'error: %(error)s.') %
+ LOG.error(_LE('Failed to issue df command for path %(path)s, '
+ 'error: %(error)s.') %
{'path': path,
'error': exc.stderr})
raise exception.VolumeBackendAPIException(data=exc.stderr)
cluster_id = lines[1].split(':')[value_token]
return cluster_id
except processutils.ProcessExecutionError as exc:
- LOG.error(_('Failed to issue mmlsconfig command, error: %s.') %
+ LOG.error(_LE('Failed to issue mmlsconfig command, error: %s.') %
exc.stderr)
raise exception.VolumeBackendAPIException(data=exc.stderr)
(out, err) = self._execute('mmlsattr', '-L', path,
run_as_root=True)
except processutils.ProcessExecutionError as exc:
- LOG.error(_('Failed to issue mmlsattr command on path %(path)s, '
- 'error: %(error)s') %
+ LOG.error(_LE('Failed to issue mmlsattr command on path %(path)s, '
+ 'error: %(error)s') %
{'path': path,
'error': exc.stderr})
raise exception.VolumeBackendAPIException(data=exc.stderr)
(out, err) = self._execute('mmlsfs', filesystem, '-V', '-Y',
run_as_root=True)
except processutils.ProcessExecutionError as exc:
- LOG.error(_('Failed to issue mmlsfs command for path %(path)s, '
- 'error: %(error)s.') %
+ LOG.error(_LE('Failed to issue mmlsfs command for path %(path)s, '
+ 'error: %(error)s.') %
{'path': path,
'error': exc.stderr})
raise exception.VolumeBackendAPIException(data=exc.stderr)
(out, err) = self._execute('mmlsconfig', 'minreleaseLeveldaemon',
'-Y', run_as_root=True)
except processutils.ProcessExecutionError as exc:
- LOG.error(_('Failed to issue mmlsconfig command, error: %s.') %
+ LOG.error(_LE('Failed to issue mmlsconfig command, error: %s.') %
exc.stderr)
raise exception.VolumeBackendAPIException(data=exc.stderr)
try:
self._execute('mmlsattr', directory, run_as_root=True)
except processutils.ProcessExecutionError as exc:
- LOG.error(_('Failed to issue mmlsattr command for path %(path)s, '
- 'error: %(error)s.') %
+ LOG.error(_LE('Failed to issue mmlsattr command '
+ 'for path %(path)s, '
+ 'error: %(error)s.') %
{'path': directory,
'error': exc.stderr})
raise exception.VolumeBackendAPIException(data=exc.stderr)
from cinder import context
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
from cinder.openstack.common import loopingcall
from cinder import utils
"""
volume_defined = self._helpers.is_vdisk_defined(volume['name'])
if not volume_defined:
- LOG.error(_('ensure_export: Volume %s not found on storage')
+ LOG.error(_LE('ensure_export: Volume %s not found on storage')
% volume['name'])
def create_export(self, ctxt, volume):
preferred_node = volume_attributes['preferred_node_id']
IO_group = volume_attributes['IO_group_id']
except KeyError as e:
- LOG.error(_('Did not find expected column name in '
- 'lsvdisk: %s') % e)
+ LOG.error(_LE('Did not find expected column name in '
+ 'lsvdisk: %s') % e)
msg = (_('initialize_connection: Missing volume '
'attribute for volume %s') % volume_name)
raise exception.VolumeBackendAPIException(data=msg)
except Exception:
with excutils.save_and_reraise_exception():
self.terminate_connection(volume, connector)
- LOG.error(_('initialize_connection: Failed to collect return '
- 'properties for volume %(vol)s and connector '
- '%(conn)s.\n') % {'vol': volume,
- 'conn': connector})
+ LOG.error(_LE('initialize_connection: Failed '
+ 'to collect return '
+ 'properties for volume %(vol)s and connector '
+ '%(conn)s.\n') % {'vol': volume,
+ 'conn': connector})
LOG.debug('leave: initialize_connection:\n volume: %(vol)s\n '
'connector %(conn)s\n properties: %(prop)s'
from cinder import context
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
from cinder.openstack.common import loopingcall
from cinder.volume.drivers.ibm.storwize_svc import ssh as storwize_ssh
key = 'protocol'
words = value.split()
if not (words and len(words) == 2 and words[0] == '<in>'):
- LOG.error(_('Protocol must be specified as '
- '\'<in> iSCSI\' or \'<in> FC\'.'))
+ LOG.error(_LE('Protocol must be specified as '
+ '\'<in> iSCSI\' or \'<in> FC\'.'))
del words[0]
value = words[0]
key = 'replication'
words = value.split()
if not (words and len(words) == 2 and words[0] == '<is>'):
- LOG.error(_('Replication must be specified as '
- '\'<is> True\' or \'<is> False\'.'))
+ LOG.error(_LE('Replication must be specified as '
+ '\'<is> True\' or \'<is> False\'.'))
del words[0]
value = words[0]
from oslo.concurrency import processutils
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
LOG = logging.getLogger(__name__)
raise exception.VolumeBackendAPIException(data=msg)
if err.startswith('CMMVC6071E'):
if not multihostmap:
- LOG.error(_('storwize_svc_multihostmap_enabled is set '
- 'to False, not allowing multi host mapping.'))
+ LOG.error(_LE('storwize_svc_multihostmap_enabled is set '
+ 'to False, not allowing multi host mapping.'))
msg = 'CMMVC6071E The VDisk-to-host mapping '\
'was not created because the VDisk is '\
'already mapped to a host.\n"'
from cinder import context
from cinder import exception
from cinder import flow_utils
-from cinder.i18n import _
+from cinder.i18n import _, _LE, _LI
from cinder.openstack.common import log as logging
from cinder.openstack.common import loopingcall
from cinder.volume import qos_specs
self.client = self._create_client()
except hpexceptions.UnsupportedVersion as ex:
raise exception.InvalidInput(ex)
- LOG.info(_("HP3PARCommon %(common_ver)s, hp3parclient %(rest_ver)s")
+ LOG.info(_LI("HP3PARCommon %(common_ver)s, hp3parclient %(rest_ver)s")
% {"common_ver": self.VERSION,
"rest_ver": hp3parclient.get_version_string()})
if self.config.hp3par_debug:
{'newName': new_vol_name,
'comment': json.dumps(new_comment)})
- LOG.info(_("Virtual volume '%(ref)s' renamed to '%(new)s'.") %
- {'ref': target_vol_name, 'new': new_vol_name})
+ LOG.info(_LI("Virtual volume '%(ref)s' renamed to '%(new)s'.") %
+ {'ref': existing_ref['source-name'], 'new': new_vol_name})
retyped = False
model_update = None
if volume_type:
- LOG.info(_("Virtual volume %(disp)s '%(new)s' is being retyped.") %
+ LOG.info(_LI("Virtual volume %(disp)s '%(new)s' is "
+ "being retyped.") %
{'disp': display_name, 'new': new_vol_name})
try:
retyped, model_update = self._retype_from_no_type(volume,
volume_type)
- LOG.info(_("Virtual volume %(disp)s successfully retyped to "
- "%(new_type)s.") %
+ LOG.info(_LI("Virtual volume %(disp)s successfully retyped to "
+ "%(new_type)s.") %
{'disp': display_name,
'new_type': volume_type.get('name')})
except Exception:
if retyped and model_update:
updates.update(model_update)
- LOG.info(_("Virtual volume %(disp)s '%(new)s' is now being managed.") %
+ LOG.info(_LI("Virtual volume %(disp)s '%(new)s' is "
+ "now being managed.") %
{'disp': display_name, 'new': new_vol_name})
# Return display name to update the name displayed in the GUI and
new_vol_name = self._get_3par_unm_name(volume['id'])
self.client.modifyVolume(vol_name, {'newName': new_vol_name})
- LOG.info(_("Virtual volume %(disp)s '%(vol)s' is no longer managed. "
- "Volume renamed to '%(new)s'.") %
+ LOG.info(_LI("Virtual volume %(disp)s '%(vol)s' is no longer managed. "
+ "Volume renamed to '%(new)s'.") %
{'disp': volume['display_name'],
'vol': vol_name,
'new': new_vol_name})
growth_size_mib,
_convert_to_base=True)
else:
- LOG.error(_("Error extending volume: %(vol)s. "
- "Exception: %(ex)s") %
+ LOG.error(_LE("Error extending volume: %(vol)s. "
+ "Exception: %(ex)s") %
{'vol': volume_name, 'ex': ex})
return model_update
self.client.createQoSRules(vvs_name, qosRule)
except Exception:
with excutils.save_and_reraise_exception():
- LOG.error(_("Error creating QOS rule %s") % qosRule)
+ LOG.error(_LE("Error creating QOS rule %s") % qosRule)
def _add_volume_to_volume_set(self, volume, volume_name,
cpg, vvs_name, qos):
{'id': volume['id'], 'size': growth_size})
self.client.growVolume(volume_name, growth_size_mib)
except Exception as ex:
- LOG.error(_("Error extending volume %(id)s. Ex: %(ex)s") %
+ LOG.error(_LE("Error extending volume %(id)s. "
+ "Ex: %(ex)s") %
{'id': volume['id'], 'ex': ex})
# Delete the volume if unable to grow it
self.client.deleteVolume(volume_name)
instance_uuid)
except Exception:
with excutils.save_and_reraise_exception():
- LOG.error(_("Error attaching volume %s") % volume)
+ LOG.error(_LE("Error attaching volume %s") % volume)
def detach_volume(self, volume):
LOG.debug("Detach Volume\n%s" % pprint.pformat(volume))
self.clear_volume_key_value_pair(volume, 'HPQ-CS-instance_uuid')
except Exception:
with excutils.save_and_reraise_exception():
- LOG.error(_("Error detaching volume %s") % volume)
+ LOG.error(_LE("Error detaching volume %s") % volume)
def migrate_volume(self, volume, host):
"""Migrate directly if source and dest are managed by same storage.
try:
ret = self.retype(volume, volume_type, None, host)
except Exception as e:
- LOG.info(_('3PAR driver cannot perform migration. '
- 'Retype exception: %s') % six.text_type(e))
+ LOG.info(_LI('3PAR driver cannot perform migration. '
+ 'Retype exception: %s') % six.text_type(e))
LOG.debug('leave: migrate_volume: id=%(id)s, host=%(host)s.' % dbg)
LOG.debug('migrate_volume result: %s, %s' % ret)
# Rename the new volume to the original name
self.client.modifyVolume(temp_vol_name, {'newName': volume_name})
- LOG.info(_('Completed: convert_to_base_volume: '
- 'id=%s.') % volume['id'])
+ LOG.info(_LI('Completed: convert_to_base_volume: '
+ 'id=%s.') % volume['id'])
except hpexceptions.HTTPConflict:
msg = _("Volume (%s) already exists on array.") % volume_name
LOG.error(msg)
if old_tpvv == new_tpvv:
if new_cpg != old_cpg:
- LOG.info(_("Modifying %(volume_name)s userCPG from %(old_cpg)s"
- " to %(new_cpg)s") %
+ LOG.info(_LI("Modifying %(volume_name)s userCPG "
+ "from %(old_cpg)s"
+ " to %(new_cpg)s") %
{'volume_name': volume_name,
'old_cpg': old_cpg, 'new_cpg': new_cpg})
_response, body = self.client.modifyVolume(
else:
if old_tpvv:
cop = self.CONVERT_TO_FULL
- LOG.info(_("Converting %(volume_name)s to full provisioning "
- "with userCPG=%(new_cpg)s") %
+ LOG.info(_LI("Converting %(volume_name)s to full provisioning "
+ "with userCPG=%(new_cpg)s") %
{'volume_name': volume_name, 'new_cpg': new_cpg})
else:
cop = self.CONVERT_TO_THIN
- LOG.info(_("Converting %(volume_name)s to thin provisioning "
- "with userCPG=%(new_cpg)s") %
+ LOG.info(_LI("Converting %(volume_name)s to thin provisioning "
+ "with userCPG=%(new_cpg)s") %
{'volume_name': volume_name, 'new_cpg': new_cpg})
try:
# Cannot retype with snapshots because we don't want to
# use keepVV and have straggling volumes. Log additional
# info and then raise.
- LOG.info(_("tunevv failed because the volume '%s' "
- "has snapshots.") % volume_name)
+ LOG.info(_LI("tunevv failed because the volume '%s' "
+ "has snapshots.") % volume_name)
raise ex
task_id = body['taskid']
if new_snap_cpg != old_snap_cpg:
# Modify the snap_cpg. This will fail with snapshots.
- LOG.info(_("Modifying %(volume_name)s snap_cpg from "
- "%(old_snap_cpg)s to %(new_snap_cpg)s.") %
+ LOG.info(_LI("Modifying %(volume_name)s snap_cpg from "
+ "%(old_snap_cpg)s to %(new_snap_cpg)s.") %
{'volume_name': volume_name,
'old_snap_cpg': old_snap_cpg,
'new_snap_cpg': new_snap_cpg})
'comment': json.dumps(comment_dict)})
self.needs_revert = True
else:
- LOG.info(_("Modifying %s comments.") % volume_name)
+ LOG.info(_LI("Modifying %s comments.") % volume_name)
common.client.modifyVolume(
volume_name,
{'comment': json.dumps(comment_dict)})
def revert(self, common, volume_name, old_snap_cpg, new_snap_cpg,
old_comment, **kwargs):
if self.needs_revert:
- LOG.info(_("Retype revert %(volume_name)s snap_cpg from "
- "%(new_snap_cpg)s back to %(old_snap_cpg)s.") %
+ LOG.info(_LI("Retype revert %(volume_name)s snap_cpg from "
+ "%(new_snap_cpg)s back to %(old_snap_cpg)s.") %
{'volume_name': volume_name,
'new_snap_cpg': new_snap_cpg,
'old_snap_cpg': old_snap_cpg})
volume_name,
{'snapCPG': old_snap_cpg, 'comment': old_comment})
except Exception as ex:
- LOG.error(_("Exception during snapCPG revert: %s") % ex)
+ LOG.error(_LE("Exception during snapCPG revert: %s") % ex)
class TuneVolumeTask(flow_utils.CinderTask):
except hpexceptions.HTTPNotFound as ex:
# HTTPNotFound(code=102) is OK. Set does not exist.
if ex.get_code() != 102:
- LOG.error(
- _("Unexpected error when retype() tried to "
- "deleteVolumeSet(%s)") % vvs_name)
+ LOG.error(_LE("Unexpected error when retype() tried to "
+ "deleteVolumeSet(%s)") % vvs_name)
raise ex
if new_vvs or new_qos:
except hpexceptions.HTTPNotFound as ex:
# HTTPNotFound(code=102) is OK. Set does not exist.
if ex.get_code() != 102:
- LOG.error(
- _("Unexpected error when retype() revert "
- "tried to deleteVolumeSet(%s)") % vvs_name)
+ LOG.error(_LE("Unexpected error when retype() revert "
+ "tried to deleteVolumeSet(%s)") % vvs_name)
except Exception:
- LOG.error(
- _("Unexpected error when retype() revert "
- "tried to deleteVolumeSet(%s)") % vvs_name)
+ LOG.error(_LE("Unexpected error when retype() revert "
+ "tried to deleteVolumeSet(%s)") % vvs_name)
if old_vvs is not None or old_qos is not None:
try:
common._add_volume_to_volume_set(
volume, volume_name, old_cpg, old_vvs, old_qos)
except Exception as ex:
- LOG.error(
- _("%(exception)s: Exception during revert of "
- "retype for volume %(volume_name)s. "
- "Original volume set/QOS settings may not "
- "have been fully restored.") %
- {'exception': ex, 'volume_name': volume_name})
+ LOG.error(_LE("%(exception)s: Exception during revert of "
+ "retype for volume %(volume_name)s. "
+ "Original volume set/QOS settings may not "
+ "have been fully restored.") %
+ {'exception': ex, 'volume_name': volume_name})
if new_vvs is not None and old_vvs != new_vvs:
try:
common.client.removeVolumeFromVolumeSet(
new_vvs, volume_name)
except Exception as ex:
- LOG.error(
- _("%(exception)s: Exception during revert of "
- "retype for volume %(volume_name)s. "
- "Failed to remove from new volume set "
- "%(new_vvs)s.") %
- {'exception': ex,
- 'volume_name': volume_name,
- 'new_vvs': new_vvs})
+ LOG.error(_LE("%(exception)s: Exception during revert of "
+ "retype for volume %(volume_name)s. "
+ "Failed to remove from new volume set "
+ "%(new_vvs)s.") %
+ {'exception': ex,
+ 'volume_name': volume_name,
+ 'new_vvs': new_vvs})
hpexceptions = None
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
import cinder.volume.driver
self.common.client.getHostVLUNs(hostname)
except hpexceptions.HTTPNotFound:
# No more exports for this host.
- LOG.info(_("Need to remove FC Zone, building initiator "
- "target map"))
+ LOG.info(_LI("Need to remove FC Zone, building initiator "
+ "target map"))
target_wwns, init_targ_map, _numPaths = \
self._build_initiator_target_map(connector)
hpexceptions = None
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
from cinder import utils
import cinder.volume.driver
vol_name = self.common._get_3par_vol_name(volume['id'])
self.common.client.getVolume(vol_name)
except hpexceptions.HTTPNotFound:
- LOG.error(_("Volume %s doesn't exist on array.") % vol_name)
+ LOG.error(_LE("Volume %s doesn't exist on array.") % vol_name)
else:
metadata = self.common.client.getAllVolumeMetaData(vol_name)
from oslo.utils import units
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
from cinder.volume.drivers.san.san import SanISCSIDriver
try:
self._cliq_get_volume_info(volume['name'])
except processutils.ProcessExecutionError:
- LOG.error(_("Volume did not exist. It will not be deleted"))
+ LOG.error(_LE("Volume did not exist. It will not be deleted"))
return
self._cliq_run_xml("deleteVolume", cliq_args)
try:
self._cliq_get_snapshot_info(snapshot['name'])
except processutils.ProcessExecutionError:
- LOG.error(_("Snapshot did not exist. It will not be deleted"))
+ LOG.error(_LE("Snapshot did not exist. It will not be deleted"))
return
try:
self._cliq_run_xml("deleteSnapshot", cliq_args)
from cinder import context
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log as logging
from cinder.volume.driver import ISCSIDriver
from cinder.volume import utils
volume_info = self.client.getVolumeByName(volume['name'])
self.client.deleteVolume(volume_info['id'])
except hpexceptions.HTTPNotFound:
- LOG.error(_("Volume did not exist. It will not be deleted"))
+ LOG.error(_LE("Volume did not exist. It will not be deleted"))
except Exception as ex:
raise exception.VolumeBackendAPIException(ex)
snap_info = self.client.getSnapshotByName(snapshot['name'])
self.client.deleteSnapshot(snap_info['id'])
except hpexceptions.HTTPNotFound:
- LOG.error(_("Snapshot did not exist. It will not be deleted"))
+ LOG.error(_LE("Snapshot did not exist. It will not be deleted"))
except hpexceptions.HTTPServerError as ex:
in_use_msg = 'cannot be deleted because it is a clone point'
if in_use_msg in ex.get_description():
client_value = value_map[value]
client_options[client_key] = client_value
except KeyError:
- LOG.error(_("'%(value)s' is an invalid value "
- "for extra spec '%(key)s'") %
+ LOG.error(_LE("'%(value)s' is an invalid value "
+ "for extra spec '%(key)s'") %
{'value': value, 'key': key})
return client_options
from oslo.utils import units
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import fileutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import uuidutils
if vc_version and vc_version >= self.PBM_ENABLED_VC_VERSION:
self.pbm_wsdl = self._get_pbm_wsdl_location(vc_version)
if not self.pbm_wsdl:
- LOG.error(_("Not able to configure PBM for VC server: %s"),
+ LOG.error(_LE("Not able to configure PBM for VC server: %s"),
vc_version)
raise error_util.VMwareDriverException()
self._storage_policy_enabled = True
from cinder.brick.remotefs import remotefs
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE, _LI
from cinder.openstack.common import log as logging
LOG = logging.getLogger(__name__)
options.get('pass'))
try:
- LOG.info(_('Mounting share: %s') % smbfs_share)
+ LOG.info(_LI('Mounting share: %s') % smbfs_share)
self.smb_conn.Msft_SmbMapping.Create(**smb_opts)
except wmi.x_wmi as exc:
err_msg = (_(
ctypes.pointer(total_bytes),
ctypes.pointer(free_bytes))
if retcode == 0:
- LOG.error(_("Could not get share %s capacity info.") %
+ LOG.error(_LE("Could not get share %s capacity info.") %
smbfs_share)
return 0, 0
return total_bytes.value, free_bytes.value
import time
import urllib2
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log
LOG = log.getLogger(__name__)
if err.code == httplib.NOT_FOUND:
LOG.debug('REST Not Found: %s' % err.code)
else:
- LOG.error(_('REST Not Available: %s') % err.code)
+ LOG.error(_LE('REST Not Available: %s') % err.code)
if err.code == httplib.SERVICE_UNAVAILABLE and \
retry < maxreqretries:
retry += 1
time.sleep(1)
- LOG.error(_('Server Busy retry request: %s') % retry)
+ LOG.error(_LE('Server Busy retry request: %s') % retry)
continue
if (err.code == httplib.UNAUTHORIZED or
err.code == httplib.INTERNAL_SERVER_ERROR) and \
'/access/v1' not in zfssaurl:
try:
- LOG.error(_('Authorizing request: '
- '%(zfssaurl)s'
- 'retry: %(retry)d .')
+ LOG.error(_LE('Authorizing request: '
+ '%(zfssaurl)s'
+ 'retry: %(retry)d .')
% {'zfssaurl': zfssaurl,
'retry': retry})
self._authorize()
return RestResult(err=err)
except urllib2.URLError as err:
- LOG.error(_('URLError: %s') % err.reason)
+ LOG.error(_LE('URLError: %s') % err.reason)
raise RestClientError(-1, name="ERR_URLError",
message=err.reason)
from oslo.utils import units
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LE
from cinder.openstack.common import log
from cinder.volume import driver
from cinder.volume.drivers.san import san
snapshot['volume_name'],
snapshot['name'])
if has_clones:
- LOG.error(_('Snapshot %s: has clones') % snapshot['name'])
+ LOG.error(_LE('Snapshot %s: has clones') % snapshot['name'])
raise exception.SnapshotIsBusy(snapshot_name=snapshot['name'])
self.zfssa.delete_snapshot(lcfg.zfssa_pool,
try:
self.create_volume_from_snapshot(volume, zfssa_snapshot)
except exception.VolumeBackendAPIException:
- LOG.error(_('Clone Volume:'
- '%(volume)s failed from source volume:'
- '%(src_vref)s')
+ LOG.error(_LE('Clone Volume:'
+ '%(volume)s failed from source volume:'
+ '%(src_vref)s')
% {'volume': volume['name'],
'src_vref': src_vref['name']})
# Cleanup snapshot
from cinder.brick.iscsi import iscsi
from cinder import exception
-from cinder.i18n import _
+from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
from cinder.volume import utils
try:
iscsi_target = self._get_iscsi_target(context, volume['id'])
except exception.NotFound:
- LOG.info(_("Skipping remove_export. No iscsi_target "
- "provisioned for volume: %s"), volume['id'])
+ LOG.info(_LI("Skipping remove_export. No iscsi_target "
+ "provisioned for volume: %s"), volume['id'])
return
try:
self.show_target(iscsi_target, iqn=iqn)
except Exception:
- LOG.info(_("Skipping remove_export. No iscsi_target "
- "is presently exported for volume: %s"), volume['id'])
+ LOG.info(_LI("Skipping remove_export. No iscsi_target "
+ "is presently exported for volume: %s"), volume['id'])
return
self.remove_iscsi_target(iscsi_target, 0, volume['id'], volume['name'])
iscsi_target = self._get_target_for_ensure_export(context,
volume['id'])
if iscsi_target is None:
- LOG.info(_("Skipping remove_export. No iscsi_target "
- "provisioned for volume: %s"), volume['id'])
+ LOG.info(_LI("Skipping remove_export. No iscsi_target "
+ "provisioned for volume: %s"), volume['id'])
return
chap_auth = None
# Check for https://bugs.launchpad.net/cinder/+bug/1065702
iscsi_target = self.db.volume_get_iscsi_target_num(context,
volume['id'])
except exception.NotFound:
- LOG.info(_("Skipping remove_export. No iscsi_target "
- "provisioned for volume: %s"), volume['id'])
+ LOG.info(_LI("Skipping remove_export. No iscsi_target "
+ "provisioned for volume: %s"), volume['id'])
return
self.remove_iscsi_target(iscsi_target, 0, volume['id'], volume['name'])
try:
volume_info = self.db.volume_get(context, volume['id'])
except exception.NotFound:
- LOG.info(_("Skipping ensure_export. No iscsi_target "
- "provision for volume: %s"), volume['id'])
+ LOG.info(_LI("Skipping ensure_export. No iscsi_target "
+ "provision for volume: %s"), volume['id'])
return
(auth_method,
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
from cinder.volume import volume_types
try:
qos_specs_ref = db.qos_specs_create(context, values)
except db_exc.DBError as e:
- LOG.exception(_('DB error: %s') % e)
+ LOG.exception(_LE('DB error: %s') % e)
raise exception.QoSSpecsCreateFailed(name=name,
qos_specs=specs)
return qos_specs_ref
try:
res = db.qos_specs_update(context, qos_specs_id, specs)
except db_exc.DBError as e:
- LOG.exception(_('DB error: %s') % e)
+ LOG.exception(_LE('DB error: %s') % e)
raise exception.QoSSpecsUpdateFailed(specs_id=qos_specs_id,
qos_specs=specs)
# query returns a list of volume types associated with qos specs
associates = db.qos_specs_associations_get(context, specs_id)
except db_exc.DBError as e:
- LOG.exception(_('DB error: %s') % e)
+ LOG.exception(_LE('DB error: %s') % e)
msg = _('Failed to get all associations of '
'qos specs %s') % specs_id
LOG.warn(msg)
else:
db.qos_specs_associate(context, specs_id, type_id)
except db_exc.DBError as e:
- LOG.exception(_('DB error: %s') % e)
+ LOG.exception(_LE('DB error: %s') % e)
LOG.warn(_('Failed to associate qos specs '
'%(id)s with type: %(vol_type_id)s') %
dict(id=specs_id, vol_type_id=type_id))
get_qos_specs(context, specs_id)
db.qos_specs_disassociate(context, specs_id, type_id)
except db_exc.DBError as e:
- LOG.exception(_('DB error: %s') % e)
+ LOG.exception(_LE('DB error: %s') % e)
LOG.warn(_('Failed to disassociate qos specs '
'%(id)s with type: %(vol_type_id)s') %
dict(id=specs_id, vol_type_id=type_id))
get_qos_specs(context, specs_id)
db.qos_specs_disassociate_all(context, specs_id)
except db_exc.DBError as e:
- LOG.exception(_('DB error: %s') % e)
+ LOG.exception(_LE('DB error: %s') % e)
LOG.warn(_('Failed to disassociate qos specs %s.') % specs_id)
raise exception.QoSSpecsDisassociateFailed(specs_id=specs_id,
type_id=None)