heat engine : Re-resolve resource static data before create

Re-resolve the template static data before creating the resource,
or we resolve the wrong value for the AWS::StackId pseudo parameter
which is updated after the parser.Stack gets stored.

ref bug 1131666

Change-Id: I68e87366d379356fd7f2685367300abe5594d6f6
This commit is contained in:
Steven Hardy 2013-02-26 14:17:00 +00:00
parent f4fcb7bd5a
commit 83780a788f
1 changed files with 10 additions and 0 deletions

View File

@ -127,6 +127,7 @@ class Resource(object):
self.stack = stack
self.context = stack.context
self.name = name
self.json_snippet = json_snippet
self.t = stack.resolve_static_data(json_snippet)
self.properties = Properties(self.properties_schema,
self.t.get('Properties', {}),
@ -282,6 +283,15 @@ class Resource(object):
logger.info('creating %s' % str(self))
# Re-resolve the template, since if the resource Ref's
# the AWS::StackId pseudo parameter, it will change after
# the parser.Stack is stored (which is after the resources
# are __init__'d, but before they are create()'d)
self.t = self.stack.resolve_static_data(self.json_snippet)
self.properties = Properties(self.properties_schema,
self.t.get('Properties', {}),
self.stack.resolve_runtime_data,
self.name)
try:
err = self.properties.validate()
if err: