migrate provisioner to use Updater class

This commit is contained in:
Paulo Bittencourt 2014-06-01 17:45:18 -04:00
parent 04dee9b353
commit 5581f1cbe9
1 changed files with 7 additions and 6 deletions

View File

@ -1,19 +1,20 @@
require 'vagrant-hostmanager/hosts_file/updater'
module VagrantPlugins
module HostManager
class Provisioner < Vagrant.plugin('2', :provisioner)
include HostsFile
def initialize(machine, config)
super(machine, config)
@global_env = machine.env
@provider = machine.provider_name
@config = Util.get_config(@global_env)
global_env = machine.env
@config = Util.get_config(global_env)
@updater = HostsFile::Updater.new(global_env, machine.provider_name)
end
def provision
update_guest(@machine)
@updater.update_guest(@machine)
if @config.hostmanager.manage_host?
update_host
@updater.update_host
end
end
end