migrate UpdateGuest action to use Updater class

This commit is contained in:
Paulo Bittencourt 2014-06-01 17:01:07 -04:00
parent f46b0aa984
commit 04dee9b353
1 changed files with 3 additions and 6 deletions

View File

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