"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/volume/drivers/dell_emc/powermax/common.py" between
cinder-17.0.0.tar.gz and cinder-17.0.1.tar.gz

About: OpenStack Cinder (Core Service: Block Storage) provides persistent block storage to running instances. Its pluggable driver architecture facilitates the creation and management of block storage devices.
The "Victoria" series (latest release).

common.py  (cinder-17.0.0):common.py  (cinder-17.0.1)
skipping to change at line 2931 skipping to change at line 2931
:param extra_specs: extra specifications :param extra_specs: extra specifications
:param tgt_only: Flag to specify if it is a target :param tgt_only: Flag to specify if it is a target
:param source_device_id: source_device_id if it has one :param source_device_id: source_device_id if it has one
""" """
if not source_device_id and tgt_only: if not source_device_id and tgt_only:
source_device_id = self._get_target_source_device( source_device_id = self._get_target_source_device(
array, device_id) array, device_id)
if source_device_id: if source_device_id:
@coordination.synchronized("emc-source-{src_device_id}") @coordination.synchronized("emc-source-{src_device_id}")
def do_unlink_and_delete_snap(src_device_id): def do_unlink_and_delete_snap(src_device_id):
# Check if source device exists on the array LOG.debug("Locking on source device %(device_id)s.",
try: {'device_id': src_device_id})
self.rest.get_volume(array, src_device_id)
except exception.VolumeBackendAPIException:
LOG.debug("Device %(device_id)s not found on array, no "
"sync check required.",
{'device_id': src_device_id})
return
self._do_sync_check( self._do_sync_check(
array, src_device_id, extra_specs, tgt_only) array, device_id, extra_specs, tgt_only)
do_unlink_and_delete_snap(source_device_id) do_unlink_and_delete_snap(source_device_id)
else: else:
self._do_sync_check( self._do_sync_check(
array, device_id, extra_specs, tgt_only) array, device_id, extra_specs, tgt_only)
def _do_sync_check( def _do_sync_check(
self, array, device_id, extra_specs, tgt_only=False): self, array, device_id, extra_specs, tgt_only=False):
"""Check if volume is part of a SnapVx sync process. """Check if volume is part of a SnapVx sync process.
skipping to change at line 2983 skipping to change at line 2977
def _unlink_targets_and_delete_temp_snapvx( def _unlink_targets_and_delete_temp_snapvx(
self, session, array, extra_specs): self, session, array, extra_specs):
"""Unlink target and delete the temporary snapvx if valid candidate. """Unlink target and delete the temporary snapvx if valid candidate.
:param session: the snapvx session :param session: the snapvx session
:param array: the array serial number :param array: the array serial number
:param extra_specs: extra specifications :param extra_specs: extra specifications
""" """
snap_name = session.get('snap_name') snap_name = session.get('snap_name')
if not snap_name:
msg = _("Snap_name not present in volume's snapvx session. "
"Unable to perform unlink and cleanup.")
LOG.error(msg)
raise exception.VolumeBackendAPIException(msg)
source = session.get('source_vol_id') source = session.get('source_vol_id')
snap_id = session.get('snapid') snap_id = session.get('snapid')
expired = session.get('expired') is_legacy = 'EMC_SMI' in snap_name
is_temp = utils.CLONE_SNAPSHOT_NAME in snap_name
target, cm_enabled = None, False target, cm_enabled = None, False
if session.get('target_vol_id'): if session.get('target_vol_id'):
target = session.get('target_vol_id') target = session.get('target_vol_id')
cm_enabled = session.get('copy_mode') cm_enabled = session.get('copy_mode')
if target and snap_name: if target and snap_name:
loop = True if cm_enabled else False loop = True if cm_enabled else False
LOG.debug( LOG.debug(
"Unlinking source from target. Source: %(vol)s, Target: " "Unlinking source from target. Source: %(vol)s, Target: "
"%(tgt)s, Snap id: %(snapid)s.", {'vol': source, 'tgt': target, "%(tgt)s, Snap id: %(snapid)s.", {'vol': source, 'tgt': target,
'snapid': snap_id}) 'snapid': snap_id})
self.provision.unlink_snapvx_tgt_volume( self.provision.unlink_snapvx_tgt_volume(
array, target, source, snap_name, extra_specs, snap_id, array, target, source, snap_name, extra_specs, snap_id,
loop) loop)
# Candidates for deletion: # Candidates for deletion:
# 1. If legacy snapshot with 'EMC_SMI' in snapshot name # 1. If legacy snapshot with 'EMC_SMI' in snapshot name
# 2. If snapVX snapshot with copy mode enabled # 2. If snapVX snapshot is temporary
# 3. If snapVX snapshot with copy mode disabled and not expired # If a target is present in the snap session it will be unlinked by
if ('EMC_SMI' in snap_name or cm_enabled or ( # the provision.unlink_snapvx_tgt_volume call above. This accounts
not cm_enabled and not expired)): # for both CM enabled and disabled, as such by this point there will
# either be no target or it would have been unlinked, therefore
# delete if it is legacy or temp.
if is_legacy or is_temp:
LOG.debug( LOG.debug(
"Deleting temporary snapshot. Source: %(vol)s, snap name: " "Deleting temporary snapshot. Source: %(vol)s, snap name: "
"%(name)s, snap id: %(snapid)s.", { "%(name)s, snap id: %(snapid)s.", {
'vol': source, 'name': snap_name, 'snapid': snap_id}) 'vol': source, 'name': snap_name, 'snapid': snap_id})
self.provision.delete_temp_volume_snap( self.provision.delete_temp_volume_snap(
array, snap_name, source, snap_id) array, snap_name, source, snap_id)
def _get_target_source_device(self, array, device_id): def _get_target_source_device(self, array, device_id):
"""Get the source device id of the target. """Get the source device id of the target.
 End of changes. 5 change blocks. 
14 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)