From 04dee9b353117d69f2abdb1c9116d093aac4afcd Mon Sep 17 00:00:00 2001 From: Paulo Bittencourt Date: Sun, 1 Jun 2014 17:01:07 -0400 Subject: [PATCH] migrate UpdateGuest action to use Updater class --- lib/vagrant-hostmanager/action/update_guest.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/vagrant-hostmanager/action/update_guest.rb b/lib/vagrant-hostmanager/action/update_guest.rb index 7d9a34b..3ca99d9 100644 --- a/lib/vagrant-hostmanager/action/update_guest.rb +++ b/lib/vagrant-hostmanager/action/update_guest.rb @@ -1,18 +1,15 @@ -require 'vagrant-hostmanager/hosts_file' +require 'vagrant-hostmanager/hosts_file/updater' require 'vagrant-hostmanager/util' module VagrantPlugins module HostManager module Action class UpdateGuest - include HostsFile def initialize(app, env) @app = app @machine = env[:machine] - @global_env = @machine.env - @provider = env[:provider] - @config = Util.get_config(@global_env) + @updater = HostsFile::Updater.new(@machine.env, env[:provider]) @logger = Log4r::Logger.new('vagrant::hostmanager::update_guest') end @@ -20,7 +17,7 @@ module VagrantPlugins env[:ui].info I18n.t('vagrant_hostmanager.action.update_guest', { :name => @machine.name }) - update_guest(@machine) + @updater.update_guest(@machine) @app.call(env) end