lib/sfn/api_provider/google.rb in sfn-3.0.28 vs lib/sfn/api_provider/google.rb in sfn-3.0.30

- old
+ new

@@ -1,10 +1,9 @@ require 'sfn' module Sfn module ApiProvider - module Google # Disable remote template storage def store_template(*_) end @@ -19,15 +18,15 @@ # @param stack [SparkleFormation] # @param stack_name [String] # @param c_stack [Miasma::Models::Orchestration::Stack] # @return [Hash] def extract_current_nested_template_parameters(stack, stack_name, c_stack) - if(c_stack && c_stack.data[:parent_stack]) + if c_stack && c_stack.data[:parent_stack] c_stack.data[:parent_stack].sparkleish_template(:remove_wrapper).fetch( :resources, stack_name, :properties, :parameters, Smash.new ) - elsif(stack.parent) + elsif stack.parent val = stack.parent.compile.resources.set!(stack_name).properties val.nil? ? Smash.new : val._dump else Smash.new end @@ -41,20 +40,20 @@ # Determine if parameter was set via intrinsic function # # @param val [Object] # @return [TrueClass, FalseClass] def function_set_parameter?(val) - if(val) + if val val.start_with?('$(') || val.start_with?('{{') end end # Set parameters into parent resource properites - def populate_parameters!(template, opts={}) + def populate_parameters!(template, opts = {}) result = super result.each_pair do |key, value| - if(template.parent) + if template.parent template.parent.compile.resources.set!(template.name).properties.set!(key, value) else template.compile.resources.set!(template.name).properties.set!(key, value) end end @@ -69,16 +68,14 @@ # Override template content extraction to disable scrub behavior # # @param thing [SparkleFormation, Hash] # @return [Hash] def template_content(thing, *_) - if(thing.is_a?(SparkleFormation)) + if thing.is_a?(SparkleFormation) config[:sparkle_dump] ? thing.sparkle_dump : thing.dump else thing end end - end - end end