Class: Vagrant::Action::Box::Verify

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/action/box/verify.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Verify

Returns a new instance of Verify.



5
6
7
8
# File 'lib/vagrant/action/box/verify.rb', line 5

def initialize(app, env)
  @app = app
  @env = env
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/vagrant/action/box/verify.rb', line 10

def call(env)
  @env[:ui].info I18n.t("vagrant.actions.box.verify.verifying")

  driver = Driver::VirtualBox.new(nil)
  if !driver.verify_image(env["box_directory"].join("box.ovf").to_s)
    raise Errors::BoxVerificationFailed
  end

  @app.call(env)
end