Mitchell Hashimoto 6bb621026f vagrant box add uses the new API.
This assumes VirtualBox boxes for now, which is fine.
2012-07-11 18:36:22 -07:00

25 lines
567 B
Ruby

module Vagrant
module Action
module Box
class Verify
def initialize(app, env)
@app = app
@env = env
end
def call(env)
@env[:ui].info I18n.t("vagrant.actions.box.verify.verifying")
box = env[:box_collection].find(env[:box_name], :virtualbox)
driver = Driver::VirtualBox.new(nil)
if !driver.verify_image(box.directory.join("box.ovf").to_s)
raise Errors::BoxVerificationFailed
end
@app.call(env)
end
end
end
end
end