core: Pass on the newly added box to the rest of the middleware stack

This commit is contained in:
Fabio Rehm 2013-10-04 11:24:11 -03:00
parent a92e03cf4c
commit 4fa12d896f
1 changed files with 6 additions and 3 deletions

View File

@ -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)