Sha256: a4e08ab62bd84fbb62192efd6eab3be130d2599b39c4c7300840cc28d425b927

Contents?: true

Size: 692 Bytes

Versions: 2

Compression:

Stored size: 692 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
          raise Errors::BoxNotSpecified.new if !box_name

          if !env.env.boxes.find(box_name)
            box_url = env["config"].vm.box_url
            raise Errors::BoxSpecifiedDoesntExist.new(:name => box_name) if !box_url

            env.ui.info I18n.t("vagrant.actions.vm.check_box.not_found", :name => box_name)
            Vagrant::Box.add(env.env, box_name, box_url)
            env["boxes"].reload!
          end

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

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
vagrantup-0.6.8 lib/vagrant/action/vm/check_box.rb
vagrant-0.6.8 lib/vagrant/action/vm/check_box.rb