Merge "VNX: Handle error during volume deletion"
This commit is contained in:
commit
a45d5c7751
@ -64,6 +64,10 @@ class VNXLunNotMigratingError(VNXException):
|
||||
pass
|
||||
|
||||
|
||||
class VNXLunSyncCompletedError(VNXMigrationError):
|
||||
error_code = 0x714a8021
|
||||
|
||||
|
||||
class VNXTargetNotReadyError(VNXMigrationError):
|
||||
message = 'The destination LUN is not available for migration'
|
||||
|
||||
|
@ -373,6 +373,8 @@ test_cleanup_migration:
|
||||
lun: &lun_cancel_migrate
|
||||
_methods:
|
||||
cancel_migrate:
|
||||
_properties:
|
||||
dest_lu_id: 2
|
||||
vnx:
|
||||
_methods:
|
||||
get_migration_session: *session_cancel
|
||||
@ -389,6 +391,20 @@ test_cleanup_migration_not_migrating:
|
||||
get_migration_session: *session_cancel
|
||||
get_lun: *lun_cancel_migrate_not_migrating
|
||||
|
||||
test_cleanup_migration_cancel_failed:
|
||||
lun: &lun_cancel_migrate_cancle_failed
|
||||
_methods:
|
||||
cancel_migrate:
|
||||
_raise:
|
||||
VNXLunSyncCompletedError: The LUN is not migrating
|
||||
_properties:
|
||||
wwn: test
|
||||
vnx:
|
||||
_methods:
|
||||
get_migration_session:
|
||||
_side_effect: [*session_cancel, *session_verify]
|
||||
get_lun: *lun_cancel_migrate_not_migrating
|
||||
|
||||
test_get_lun_by_name:
|
||||
lun: &lun_test_get_lun_by_name
|
||||
_properties:
|
||||
|
@ -163,6 +163,10 @@ class TestClient(test.TestCase):
|
||||
def test_cleanup_migration_not_migrating(self, client, mocked):
|
||||
client.cleanup_migration(1, 2)
|
||||
|
||||
@res_mock.patch_client
|
||||
def test_cleanup_migration_cancel_failed(self, client, mocked):
|
||||
client.cleanup_migration(1, 2)
|
||||
|
||||
@res_mock.patch_client
|
||||
def test_get_lun_by_name(self, client, mocked):
|
||||
lun = client.get_lun(name='lun_name_test_get_lun_by_name')
|
||||
|
@ -250,8 +250,12 @@ class Client(object):
|
||||
try:
|
||||
src_lun.cancel_migrate()
|
||||
except storops_ex.VNXLunNotMigratingError:
|
||||
LOG.info(_LI('The LUN is not migrating, this message can be'
|
||||
' safely ignored'))
|
||||
LOG.info(_LI('The LUN is not migrating or completed, '
|
||||
'this message can be safely ignored'))
|
||||
except (storops_ex.VNXLunSyncCompletedError,
|
||||
storops_ex.VNXMigrationError):
|
||||
# Wait until session finishes
|
||||
self.verify_migration(src_id, session.dest_lu_id, None)
|
||||
|
||||
def create_snapshot(self, lun_id, snap_name, keep_for=None):
|
||||
"""Creates a snapshot."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user