Sha256: 4fd4fd2bbde5b58c91a20532ab812cb758b02e2f3cb50edf0d9cf6826f9bdcd8

Contents?: true

Size: 777 Bytes

Versions: 3

Compression:

Stored size: 777 Bytes

Contents

require "log4r"

require "tiktalik"

module VagrantPlugins
  module TiktalikVagrant
    module Action
      class PowerOn
        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant_tiktalik::action::power_on")
          @config = env[:machine].provider_config
        end

        def call(env)
          env[:ui].info(I18n.t("vagrant_tiktalik.powering_on"))

          t = Tiktalik
          t.api_key = @config.api_key
          t.api_secret_key = @config.api_secret
          t.ca_file = @config.ca_file

          i = Tiktalik::Computing::Instance
          instance = i.find env[:machine].id
          instance.start

          env[:machine].id = instance.uuid

          @app.call(env)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-tiktalik-0.0.4 lib/vagrant-tiktalik/action/power_on.rb
vagrant-tiktalik-0.0.3 lib/vagrant-tiktalik/action/power_on.rb
vagrant-tiktalik-0.0.2 lib/vagrant-tiktalik/action/power_on.rb