From 448e9429ac603eb7bd7784f29c630d3408611fa8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 10 Dec 2011 14:23:22 -0800 Subject: [PATCH] Get rid of broken env.ui calls in actions --- lib/vagrant/action/vm/discard_state.rb | 6 +++--- lib/vagrant/action/vm/network.rb | 6 +++--- lib/vagrant/action/vm/nfs.rb | 2 +- lib/vagrant/action/vm/provision.rb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/vagrant/action/vm/discard_state.rb b/lib/vagrant/action/vm/discard_state.rb index 18b82f578..608e29809 100644 --- a/lib/vagrant/action/vm/discard_state.rb +++ b/lib/vagrant/action/vm/discard_state.rb @@ -9,9 +9,9 @@ module Vagrant end def call(env) - if env["vm"].created? && env["vm"].vm.saved? - env.ui.info I18n.t("vagrant.actions.vm.discard_state.discarding") - env["vm"].vm.discard_state + if env[:vm].created? && env[:vm].vm.saved? + env[:ui].info I18n.t("vagrant.actions.vm.discard_state.discarding") + env[:vm].vm.discard_state end @app.call(env) diff --git a/lib/vagrant/action/vm/network.rb b/lib/vagrant/action/vm/network.rb index 10c6ae905..64d4dab34 100644 --- a/lib/vagrant/action/vm/network.rb +++ b/lib/vagrant/action/vm/network.rb @@ -65,9 +65,9 @@ module Vagrant # Enables and assigns the host only network to the proper # adapter on the VM, and saves the adapter. def assign_network - @env.ui.info I18n.t("vagrant.actions.vm.network.preparing") + @env[:ui].info I18n.t("vagrant.actions.vm.network.preparing") - @env.env.config.vm.network_options.compact.each do |network_options| + @env.[:vm].config.vm.network_options.compact.each do |network_options| adapter = @env["vm"].vm.network_adapters[network_options[:adapter]] adapter.enabled = true adapter.attachment_type = :host_only @@ -98,7 +98,7 @@ module Vagrant raise Errors::NetworkNotFound, :name => net_options[:name] if net_options[:name] # One doesn't exist, create it. - @env.ui.info I18n.t("vagrant.actions.vm.network.creating") + @env[:ui].info I18n.t("vagrant.actions.vm.network.creating") ni = interfaces.create ni.enable_static(network_ip(net_options[:ip], net_options[:netmask]), diff --git a/lib/vagrant/action/vm/nfs.rb b/lib/vagrant/action/vm/nfs.rb index 05b1e458c..0c90b4741 100644 --- a/lib/vagrant/action/vm/nfs.rb +++ b/lib/vagrant/action/vm/nfs.rb @@ -111,7 +111,7 @@ module Vagrant # Uses the system class to mount the NFS folders. def mount_folders - @env.ui.info I18n.t("vagrant.actions.vm.nfs.mounting") + @env[:ui].info I18n.t("vagrant.actions.vm.nfs.mounting") # Only mount the folders which have a guest path specified am_folders = folders.select { |name, folder| folder[:guestpath] } diff --git a/lib/vagrant/action/vm/provision.rb b/lib/vagrant/action/vm/provision.rb index 4b810d410..9cb1ba43b 100644 --- a/lib/vagrant/action/vm/provision.rb +++ b/lib/vagrant/action/vm/provision.rb @@ -18,7 +18,7 @@ module Vagrant # Take prepared provisioners and run the provisioning provisioners.each do |instance| - @env.ui.info I18n.t("vagrant.actions.vm.provision.beginning", :provisioner => instance.class) + @env[:ui].info I18n.t("vagrant.actions.vm.provision.beginning", :provisioner => instance.class) instance.provision! end end