From 06a7c8831647e632a6a57ee688f6f4d710663205 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 11 Feb 2014 16:05:26 -0800 Subject: [PATCH] core: HandleBox keeps the same machine instance --- lib/vagrant/action/builtin/handle_box.rb | 7 ++++--- lib/vagrant/machine.rb | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/vagrant/action/builtin/handle_box.rb b/lib/vagrant/action/builtin/handle_box.rb index d4100748e..0b137459d 100644 --- a/lib/vagrant/action/builtin/handle_box.rb +++ b/lib/vagrant/action/builtin/handle_box.rb @@ -45,11 +45,12 @@ module Vagrant if box_updated # Reload the environment and set the VM to be the new loaded VM. - old_machine = env[:machine] - env[:machine] = machine.vagrantfile.machine( + new_machine = machine.vagrantfile.machine( machine.name, machine.provider_name, machine.env.boxes, machine.data_dir, machine.env) - env[:machine].ui = old_machine.ui + env[:machine].box = new_machine.box + env[:machine].config = new_machine.config + env[:machine].provider_config = new_machine.provider_config end @app.call(env) diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 9238ce40b..3ca3b4e23 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -15,7 +15,7 @@ module Vagrant # Configuration for the machine. # # @return [Object] - attr_reader :config + attr_accessor :config # Directory where machine-specific data can be stored. # @@ -47,7 +47,7 @@ module Vagrant # The provider-specific configuration for this machine. # # @return [Object] - attr_reader :provider_config + attr_accessor :provider_config # The name of the provider. #