From 4fa12d896fb6b64961eaddbe14533d88e499ad6f Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 4 Oct 2013 11:24:11 -0300 Subject: [PATCH] core: Pass on the newly added box to the rest of the middleware stack --- lib/vagrant/action/builtin/box_add.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/action/builtin/box_add.rb b/lib/vagrant/action/builtin/box_add.rb index 380a2cc39..f05f9a6d4 100644 --- a/lib/vagrant/action/builtin/box_add.rb +++ b/lib/vagrant/action/builtin/box_add.rb @@ -57,9 +57,9 @@ module Vagrant # Add the box env[:ui].info I18n.t("vagrant.actions.box.add.adding", :name => env[:box_name]) - added_box = nil + box_added = nil begin - added_box = env[:box_collection].add( + box_added = env[:box_collection].add( @temp_path, env[:box_name], box_formats, env[:box_force]) rescue Vagrant::Errors::BoxUpgradeRequired # Upgrade the box @@ -75,7 +75,10 @@ module Vagrant # Success, we added a box! env[:ui].success( - I18n.t("vagrant.actions.box.add.added", name: added_box.name, provider: added_box.provider)) + I18n.t("vagrant.actions.box.add.added", name: box_added.name, provider: box_added.provider)) + + # Passes on the newly added box to the rest of the middleware chain + env[:box_added] = box_added # Carry on! @app.call(env)