Merge "Unity: unexpected data in share from snapshot" into stable/ocata

This commit is contained in:
Jenkins 2017-07-31 12:25:47 +00:00 committed by Gerrit Code Review
commit 1a3fadd2f1
4 changed files with 10 additions and 13 deletions

View File

@ -212,18 +212,14 @@ class UnityClient(object):
LOG.info(_LI('Snapshot %(snap)s on Filesystem %(fs)s already '
'exists.'), {'snap': name, 'fs': filesystem.name})
def create_snap_of_snap(self, src_snap, dst_snap_name, snap_type):
access_type = enums.FilesystemSnapAccessTypeEnum.PROTOCOL
if snap_type == 'checkpoint':
access_type = enums.FilesystemSnapAccessTypeEnum.CHECKPOINT
def create_snap_of_snap(self, src_snap, dst_snap_name):
if isinstance(src_snap, six.string_types):
snap = self.get_snapshot(name=src_snap)
else:
snap = src_snap
try:
return snap.create_snap(dst_snap_name, fs_access_type=access_type)
return snap.create_snap(dst_snap_name)
except storops_ex.UnitySnapNameInUseError:
return self.get_snapshot(dst_snap_name)

View File

@ -213,8 +213,7 @@ class UnityStorageConnection(driver.StorageConnection):
raise exception.EMCUnityError(err=message)
backend_snap = self.client.create_snap_of_snap(snapshot['id'],
share_name,
snap_type='snapshot')
share_name)
locations = None
if share_proto == 'CIFS':
@ -274,9 +273,7 @@ class UnityStorageConnection(driver.StorageConnection):
snapshot_name = snapshot['id']
if self._is_share_from_snapshot(backend_share):
self.client.create_snap_of_snap(backend_share.snap,
snapshot_name,
snap_type='checkpoint')
self.client.create_snap_of_snap(backend_share.snap, snapshot_name)
else:
self.client.create_snapshot(backend_share.filesystem,
snapshot_name)

View File

@ -148,8 +148,7 @@ class TestClient(test.TestCase):
snapshot = mocked_input['src_snapshot']
dest_snap = mocked_input['dest_snapshot']
new_snap = client.create_snap_of_snap(
snapshot, dest_snap.name, 'checkpoint')
new_snap = client.create_snap_of_snap(snapshot, dest_snap.name)
self.assertEqual(dest_snap.name, new_snap.name)

View File

@ -0,0 +1,5 @@
---
fixes:
- Fixed bug in Dell EMC Unity driver that caused shares created from
snapshots to contain data from the original shares, instead of data from
their snapshots.