migrate UpdateGuest action to use Updater class
This commit is contained in:
parent
f46b0aa984
commit
04dee9b353
|
@ -1,18 +1,15 @@
|
||||||
require 'vagrant-hostmanager/hosts_file'
|
require 'vagrant-hostmanager/hosts_file/updater'
|
||||||
require 'vagrant-hostmanager/util'
|
require 'vagrant-hostmanager/util'
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module HostManager
|
module HostManager
|
||||||
module Action
|
module Action
|
||||||
class UpdateGuest
|
class UpdateGuest
|
||||||
include HostsFile
|
|
||||||
|
|
||||||
def initialize(app, env)
|
def initialize(app, env)
|
||||||
@app = app
|
@app = app
|
||||||
@machine = env[:machine]
|
@machine = env[:machine]
|
||||||
@global_env = @machine.env
|
@updater = HostsFile::Updater.new(@machine.env, env[:provider])
|
||||||
@provider = env[:provider]
|
|
||||||
@config = Util.get_config(@global_env)
|
|
||||||
@logger = Log4r::Logger.new('vagrant::hostmanager::update_guest')
|
@logger = Log4r::Logger.new('vagrant::hostmanager::update_guest')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -20,7 +17,7 @@ module VagrantPlugins
|
||||||
env[:ui].info I18n.t('vagrant_hostmanager.action.update_guest', {
|
env[:ui].info I18n.t('vagrant_hostmanager.action.update_guest', {
|
||||||
:name => @machine.name
|
:name => @machine.name
|
||||||
})
|
})
|
||||||
update_guest(@machine)
|
@updater.update_guest(@machine)
|
||||||
|
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue