Skip to content

Commit

Permalink
heat engine : Re-resolve resource static data before create
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Steven Hardy committed Feb 27, 2013
1 parent f4fcb7b commit 83780a7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions heat/engine/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def __init__(self, name, json_snippet, stack):
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', {}),
Expand Down Expand Up @@ -282,6 +283,15 @@ def create(self):

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:
Expand Down

0 comments on commit 83780a7

Please sign in to comment.