migrate provisioner to use Updater class
This commit is contained in:
parent
04dee9b353
commit
5581f1cbe9
|
@ -1,19 +1,20 @@
|
||||||
|
require 'vagrant-hostmanager/hosts_file/updater'
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module HostManager
|
module HostManager
|
||||||
class Provisioner < Vagrant.plugin('2', :provisioner)
|
class Provisioner < Vagrant.plugin('2', :provisioner)
|
||||||
include HostsFile
|
|
||||||
|
|
||||||
def initialize(machine, config)
|
def initialize(machine, config)
|
||||||
super(machine, config)
|
super(machine, config)
|
||||||
@global_env = machine.env
|
global_env = machine.env
|
||||||
@provider = machine.provider_name
|
@config = Util.get_config(global_env)
|
||||||
@config = Util.get_config(@global_env)
|
@updater = HostsFile::Updater.new(global_env, machine.provider_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def provision
|
def provision
|
||||||
update_guest(@machine)
|
@updater.update_guest(@machine)
|
||||||
if @config.hostmanager.manage_host?
|
if @config.hostmanager.manage_host?
|
||||||
update_host
|
@updater.update_host
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue