Sha256: 71afff1da0bad85df49e0d4b72fb9f35add57bbb106aa80e88a80596bf65c5f9
Contents?: true
Size: 974 Bytes
Versions: 40
Compression:
Stored size: 974 Bytes
Contents
module Vagrant module Action module VM class CheckBox def initialize(app, env) @app = app end def call(env) box_name = env[:vm].config.vm.box raise Errors::BoxNotSpecified if !box_name if !env[:box_collection].find(box_name) box_url = env[:vm].config.vm.box_url raise Errors::BoxSpecifiedDoesntExist, :name => box_name if !box_url # Add the box then reload the box collection so that it becomes # aware of it. env[:ui].info I18n.t("vagrant.actions.vm.check_box.not_found", :name => box_name) env[:box_collection].add(box_name, box_url) env[:box_collection].reload! # Reload the environment and set the VM to be the new loaded VM. env[:vm].env.reload! env[:vm] = env[:vm].env.vms[env[:vm].name] end @app.call(env) end end end end end
Version data entries
40 entries across 40 versions & 6 rubygems