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)