From ab60d9b97f51a61f9a619aa902670a9ac2661489 Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Fri, 17 May 2013 14:20:31 +0100 Subject: [PATCH] engine : remove unused update states/status We have some aws-isms in the update code related to different update states, which is not actually used anywhere, so may as well remove it - it's probably easier at least for now to focus on the three update states of COMPLETE/FAILED/REPLACEMENT Change-Id: Ieeaf92ab0fec6bbfab3dddf2d8fecb0b38c1b2fc --- heat/engine/parser.py | 13 ++++--------- heat/engine/resource.py | 6 +----- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/heat/engine/parser.py b/heat/engine/parser.py index 492491e6..637407d5 100644 --- a/heat/engine/parser.py +++ b/heat/engine/parser.py @@ -375,16 +375,11 @@ class Stack(object): # based on the parsed template snippet for the resource. # If this test fails, we call the underlying resource.update # - # FIXME : Implement proper update logic for the resources - # AWS define three update strategies, applied depending - # on the resource and what is being updated within a - # resource : - # - Update with no interruption - # - Update with some interruption - # - Update requires replacement - # - # Currently all resource have a default handle_update method + # Currently many resources have a default handle_update method # which returns "requires replacement" (res.UPDATE_REPLACE) + # optionally they may implement non-interruptive logic and + # return UPDATE_COMPLETE. If resources do not implement the + # handle_update method at all, update will fail. for res in newstack: # Compare resolved pre/post update resource snippets, # note the new resource snippet is resolved in the context diff --git a/heat/engine/resource.py b/heat/engine/resource.py index 67f85e8a..77b096ed 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -93,11 +93,8 @@ class Resource(object): UPDATE_FAILED = 'UPDATE_FAILED' UPDATE_COMPLETE = 'UPDATE_COMPLETE' - # Status values, returned from subclasses to indicate update method + # Status value, returned from subclasses to indicate replacement required UPDATE_REPLACE = 'UPDATE_REPLACE' - UPDATE_INTERRUPTION = 'UPDATE_INTERRUPTION' - UPDATE_NO_INTERRUPTION = 'UPDATE_NO_INTERRUPTION' - UPDATE_NOT_IMPLEMENTED = 'UPDATE_NOT_IMPLEMENTED' # If True, this resource must be created before it can be referenced. strict_dependency = True @@ -373,7 +370,6 @@ class Resource(object): logger.info('updating %s' % str(self)) - result = self.UPDATE_NOT_IMPLEMENTED try: self.state_set(self.UPDATE_IN_PROGRESS) properties = Properties(self.properties_schema, -- 2.45.2