From 4b0b5af7d29d785766c87396d74b4e643aa01230 Mon Sep 17 00:00:00 2001 From: Yuval Brik Date: Thu, 29 Sep 2016 14:15:48 +0300 Subject: [PATCH] Allow deletion of erroneous checkpoints In a case where checkpoint creation has failed, allow deletion of the stale checkpoint. Change-Id: Ia81c1ef08d5a21b534fa6123cbb4dea1abda4a2c --- karbor/services/protection/manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/karbor/services/protection/manager.py b/karbor/services/protection/manager.py index 4792bb22..525dbb1e 100644 --- a/karbor/services/protection/manager.py +++ b/karbor/services/protection/manager.py @@ -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)