From 8a5c66a0a42bd8aedee366347df4999ad6c49e7a Mon Sep 17 00:00:00 2001 From: Jason Dunsmore Date: Wed, 16 Sep 2015 16:49:14 -0500 Subject: [PATCH] Add _needs_update() to AWS::AutoScaling::LaunchConfiguration This will enable update-preview to see if the resource will be replaced during a particular stack-update. Change-Id: I4ac457725d721bfcb7e008dfe7b5239bac01a495 Partial-Bug: #1494436 --- .../resources/aws/autoscaling/launch_config.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/heat/engine/resources/aws/autoscaling/launch_config.py b/heat/engine/resources/aws/autoscaling/launch_config.py index d4c7fbd4d..46e48b33f 100644 --- a/heat/engine/resources/aws/autoscaling/launch_config.py +++ b/heat/engine/resources/aws/autoscaling/launch_config.py @@ -216,10 +216,20 @@ class LaunchConfiguration(resource.Resource): self.properties_schema, self.context) self._update_stored_properties() - def handle_update(self, json_snippet, tmpl_diff, prop_diff): + def _needs_update(self, after, before, after_props, before_props, + prev_resource, check_init_complete=True): + result = super(LaunchConfiguration, self)._needs_update( + after, before, after_props, before_props, prev_resource, + check_init_complete=check_init_complete) + + tmpl_diff = self.update_template_diff(function.resolve(after), + before) + if 'Metadata' in tmpl_diff: raise exception.UpdateReplace(self.name) + return result + def FnGetRefId(self): return self.physical_resource_name_or_FnGetRefId()