Sha256: 4edd013de2dd9092c1853f4cd360aa97daa5c717953dbfb59706e1be4cfb6d49

Contents?: true

Size: 712 Bytes

Versions: 10

Compression:

Stored size: 712 Bytes

Contents

module Vagrant
  class Action
    module VM
      class CheckBox
        def initialize(app, env)
          @app = app
        end

        def call(env)
          box_name = env["config"].vm.box
          return env.error!(:box_not_specified) if !box_name

          if !Vagrant::Box.find(env.env , box_name)
            box_url = env["config"].vm.box_url
            return env.error!(:box_specified_doesnt_exist, :box_name => box_name) if !box_url

            env.logger.info "Box #{box_name} not found. Fetching box since URL specified..."
            Vagrant::Box.add(env.env, box_name, box_url)
            env.env.load_box!
          end

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

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
vagrantup-0.5.4 lib/vagrant/action/vm/check_box.rb
vagrantup-0.5.3 lib/vagrant/action/vm/check_box.rb
vagrantup-0.5.2 lib/vagrant/action/vm/check_box.rb
vagrantup-0.5.1 lib/vagrant/action/vm/check_box.rb
vagrantup-0.5.0 lib/vagrant/action/vm/check_box.rb
vagrant-0.5.4 lib/vagrant/action/vm/check_box.rb
vagrant-0.5.3 lib/vagrant/action/vm/check_box.rb
vagrant-0.5.2 lib/vagrant/action/vm/check_box.rb
vagrant-0.5.1 lib/vagrant/action/vm/check_box.rb
vagrant-0.5.0 lib/vagrant/action/vm/check_box.rb