Merge "PowerMax Driver - Unmanage Snapshot Improvements"

This commit is contained in:
Zuul 2019-03-18 10:57:15 +00:00 committed by Gerrit Code Review
commit 723dafeb84
2 changed files with 13 additions and 4 deletions

View File

@ -2301,12 +2301,18 @@ class PowerMaxCommonTest(test.TestCase):
self.common.manage_existing_snapshot,
snapshot, existing_ref)
@mock.patch.object(common.PowerMaxCommon, '_sync_check')
@mock.patch.object(rest.PowerMaxRest, 'modify_volume_snap')
def test_unmanage_snapshot_success(self, mock_mod, mock_sync):
def test_unmanage_snapshot_success(self, mock_mod, ):
self.common.unmanage_snapshot(self.data.test_snapshot_manage)
mock_mod.assert_called_once()
@mock.patch.object(common.PowerMaxCommon, '_sync_check')
@mock.patch.object(rest.PowerMaxRest, 'modify_volume_snap')
def test_unmanage_snapshot_no_sync_check(self, mock_mod, mock_sync):
self.common.unmanage_snapshot(self.data.test_snapshot_manage)
mock_mod.assert_called_once()
mock_sync.assert_not_called()
@mock.patch.object(utils.PowerMaxUtils, 'is_volume_failed_over',
return_value=True)
def test_unmanage_snapshot_fail_failover(self, mock_failed):

View File

@ -2602,12 +2602,15 @@ class PowerMaxCommon(object):
raise exception.VolumeBackendAPIException(
message=exception_message)
self._sync_check(array, device_id, extra_specs)
LOG.info("Snapshot %(snap_name)s is no longer managed in "
"OpenStack but still remains on PowerMax/VMAX source "
"%(array_id)s", {'snap_name': snap_name, 'array_id': array})
LOG.warning("In order to remove the snapshot source volume from "
"OpenStack you will need to either delete the linked "
"SnapVX snapshot on the array or un-manage the volume "
"from Cinder.")
def get_manageable_volumes(self, marker, limit, offset, sort_keys,
sort_dirs):
"""Lists all manageable volumes.