Allow deletion of erroneous checkpoints

In a case where checkpoint creation has failed, allow deletion
of the stale checkpoint.

Change-Id: Ia81c1ef08d5a21b534fa6123cbb4dea1abda4a2c
This commit is contained in:
Yuval Brik 2016-09-29 14:15:48 +03:00
parent e846299064
commit 4b0b5af7d2
1 changed files with 2 additions and 2 deletions

View File

@ -174,9 +174,9 @@ class ProtectionManager(manager.Manager):
raise exception.InvalidInput(
reason=_("Invalid checkpoint_id or provider_id"))
if checkpoint.status in [
if checkpoint.status not in [
constants.CHECKPOINT_STATUS_AVAILABLE,
constants.CHECKPOINT_STATUS_ERROR,
constants.CHECKPOINT_STATUS_PROTECTING
]:
raise exception.CheckpointNotBeDeleted(
checkpoint_id=checkpoint_id)