From 42243ec2a5368c420629f8bea4c9c2d8c8692444 Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Fri, 28 Jun 2013 16:43:41 +0100 Subject: [PATCH] engine : simplify resource state check Simplify the test to check the resource is in a COMPLETE state (other than DELETE_COMPLETE), so we don't have to update this for every new action state which gets added Change-Id: I91286d3d0464b1a71dafd01ac209ea7ded259875 --- heat/engine/resource.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/heat/engine/resource.py b/heat/engine/resource.py index 725319f0..8a6435c1 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -444,9 +444,7 @@ class Resource(object): instances is a non-immediate operation and we want to paralellize ''' # Don't try to suspend the resource unless it's in a stable state - if self.state not in ((self.CREATE, self.COMPLETE), - (self.UPDATE, self.COMPLETE), - (self.ROLLBACK, self.COMPLETE)): + if (self.action == self.DELETE or self.status != self.COMPLETE): exc = exception.Error('State %s invalid for suspend' % str(self.state)) raise exception.ResourceFailure(exc) -- 2.45.2