From 5581f1cbe9eeeb47307c4a1917fab5189bee0593 Mon Sep 17 00:00:00 2001 From: Paulo Bittencourt Date: Sun, 1 Jun 2014 17:45:18 -0400 Subject: [PATCH] migrate provisioner to use Updater class --- lib/vagrant-hostmanager/provisioner.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/vagrant-hostmanager/provisioner.rb b/lib/vagrant-hostmanager/provisioner.rb index 27f0b33..1576c73 100644 --- a/lib/vagrant-hostmanager/provisioner.rb +++ b/lib/vagrant-hostmanager/provisioner.rb @@ -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