From c7f468012bba916732f8592a4e12d3bacd457570 Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Fri, 17 Jun 2016 12:06:21 -0400 Subject: [PATCH] cast pathname to string --- lib/vagrant-hostmanager/hosts_file/updater.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/vagrant-hostmanager/hosts_file/updater.rb b/lib/vagrant-hostmanager/hosts_file/updater.rb index a49df67..409cbf4 100644 --- a/lib/vagrant-hostmanager/hosts_file/updater.rb +++ b/lib/vagrant-hostmanager/hosts_file/updater.rb @@ -10,6 +10,8 @@ module VagrantPlugins @global_env = global_env @config = Util.get_config(@global_env) @provider = provider + @logger = Log4r::Logger.new('vagrant::hostmanager::updater') + @logger.debug("init updater") end def update_guest(machine) @@ -29,10 +31,14 @@ module VagrantPlugins # download and modify file with Vagrant-managed entries file = @global_env.tmp_path.join("hosts.#{machine.name}") machine.communicate.download(realhostfile, file) + + @logger.debug("file is: #{file.to_s}") + @logger.debug("class of file is: #{file.class}") + if update_file(file, machine, false) # upload modified file and remove temporary file - machine.communicate.upload(file, '/tmp/hosts') + machine.communicate.upload(file.to_s, '/tmp/hosts') if windir machine.communicate.sudo("mv -force /tmp/hosts/hosts.#{machine.name} #{realhostfile}") else