From 7e758d5915cdb559db0587c327f3e80189b89e9c Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Sat, 16 Mar 2013 13:37:29 -0700 Subject: [PATCH] If a stack create fails, ensure the stack is deleteable The resource delete operation attempts to delete CREATE_FAILED resources. Further it attempts to delete resources that were not created during a creation operation because further processing of the template does not take place. This patch special cases these two conditions in the delete operation. Change-Id: I1c83ba68754f38a0f7e91e77fcf02177c457504e Fixes: Bug #1155824 --- heat/engine/resource.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/heat/engine/resource.py b/heat/engine/resource.py index 450c575d..bcfef8d2 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -396,6 +396,13 @@ class Resource(object): return if self.state == self.DELETE_IN_PROGRESS: return 'Resource deletion already in progress' + if self.state == self.CREATE_FAILED: + return + # Further resources will not be created in a CREATE_FAILED stack. + # The state of these resources is None. Do not delete as an + # undeleteable stack will result + if self.state is None: + return logger.info('deleting %s (inst:%s db_id:%s)' % (str(self), self.resource_id, str(self.id))) -- 2.45.2