Sha256: ae0027a16c2faab3b94fc4a36ddda1b427998cb94e06872145197dbdc7bc639e

Contents?: true

Size: 794 Bytes

Versions: 14

Compression:

Stored size: 794 Bytes

Contents

require 'log4r'
require 'json'
require 'vagrant-skytap/setup_helper'


module VagrantPlugins
  module Skytap
    module Action
      # Adds the specified vm to this Skytap environment, assuming the vm and environment
      # both exist.
      class AddVmToEnvironment
        attr_reader :env

        def initialize(app, env)
          @app = app
          @env = env
          @logger = Log4r::Logger.new("vagrant_skytap::action::add_vm_to_environment")
        end

        def call(env)
          environment = env[:environment]
          vm = environment.add_vm(vm_url)
          env[:machine].id = vm.id
          environment.wait_until_ready

          @app.call(env)
        end

        def vm_url
          env[:machine].provider_config.vm_url
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
vagrant-skytap-0.2.2 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.2.1 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.2.0 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.1.11 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.1.10 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.1.9 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.1.8 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.1.7 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.1.6 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.1.5 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.1.4 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.1.3 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.1.2 lib/vagrant-skytap/action/add_vm_to_environment.rb
vagrant-skytap-0.1.1a lib/vagrant-skytap/action/add_vm_to_environment.rb