Sha256: 504de42b0598650ab076d0a2ea4bacf55a8637e6216f4bf2dab700b719f13d79

Contents?: true

Size: 1.41 KB

Versions: 18

Compression:

Stored size: 1.41 KB

Contents

class Lono::Sets
  class Base < Lono::Cfn::Base
    def run
      generate_all
      save
    end

    def exit_unless_updatable!
      return true if ENV['LONO_ENV']
      return false if @options[:noop]

      status = Status.new(@options) # using status for completed?
      return if status.stack_instances.empty?
      completed = status.completed?(status.stack_set_status)
      unless completed
        puts "Cannot update stack set because #{@stack} is not in an updatable state.  Stack set status: #{status.stack_set_status}".color(:red)
        quit(1)
      end
    end

    def build_options
      parameters = generate_all
      options = {
        stack_set_name: @stack,
        parameters: parameters,
        capabilities: capabilities, # ["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"]
      }
      options[:tags] = tags unless tags.empty?
      options[:operation_preferences] = operation_preferences unless operation_preferences.empty?
      options.reject! {|k, v| v.nil? }
      set_template_url!(options)
      options
    end

    def operation_preferences
      o = {}
      o[:failure_tolerance_count] = @options[:failure_tolerance_count]
      o[:failure_tolerance_percentage] = @options[:failure_tolerance_percentage]
      o[:max_concurrent_count] = @options[:max_concurrent_count]
      o[:max_concurrent_percentage] = @options[:max_concurrent_percentage]
      o.reject! {|k, v| v.nil? }
      o
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
lono-7.4.3 lib/lono/sets/base.rb
lono-7.4.2 lib/lono/sets/base.rb
lono-7.4.1 lib/lono/sets/base.rb
lono-7.4.0 lib/lono/sets/base.rb
lono-7.3.2 lib/lono/sets/base.rb
lono-7.3.1 lib/lono/sets/base.rb
lono-7.3.0 lib/lono/sets/base.rb
lono-7.2.3 lib/lono/sets/base.rb
lono-7.2.2 lib/lono/sets/base.rb
lono-7.2.1 lib/lono/sets/base.rb
lono-7.2.0 lib/lono/sets/base.rb
lono-7.1.0 lib/lono/sets/base.rb
lono-7.0.5 lib/lono/sets/base.rb
lono-7.0.4 lib/lono/sets/base.rb
lono-7.0.3 lib/lono/sets/base.rb
lono-7.0.2 lib/lono/sets/base.rb
lono-7.0.1 lib/lono/sets/base.rb
lono-7.0.0 lib/lono/sets/base.rb