Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #134 from rapid7/extension-fixes
Browse files Browse the repository at this point in the history
Add improvements useful for convection extensions
  • Loading branch information
bturner-r7 authored Jun 27, 2016
2 parents 8efdb26 + b82aa47 commit ede4680
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/convection/control/stack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ def initialize(name, template, options = {}, &block)
@current_template = {}
@last_event_seen = nil

# First pass evaluation of stack
# This is important because it:
# * Catches syntax errors before starting a converge
# * Builds a list of all resources that allows stacks early in
# the dependency tree to know about later stacks. Some
# clouds use this, for example, to create security groups early
# in the dependency tree to avoid the chicken-and-egg problem.
@template.execute

## Get initial state
get_status(cloud_name)
return unless exist?
Expand Down Expand Up @@ -379,7 +388,6 @@ def get_events(pages = nil, stack_name = id)
## TODO No. This will become unnecessary as current_state is fleshed out
def resource_attributes
@attribute_mapping_values = {}
@template.execute ## Populate mappings fro the template

@resources.each do |logical, resource|
next unless @template.attribute_mappings.include?(logical)
Expand Down
2 changes: 2 additions & 0 deletions lib/convection/model/template/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ def render
##
attribute :type
attr_reader :name
attr_reader :parent
attr_reader :template
attr_reader :properties
attr_reader :resource_attributes
Expand All @@ -293,6 +294,7 @@ def render

def initialize(name, parent)
@name = name
@parent = parent
@template = parent.template
@type = self.class.type
@depends_on = []
Expand Down

0 comments on commit ede4680

Please sign in to comment.