Skip to content

Commit

Permalink
Merge pull request #199 from austinlparker/fix-upload
Browse files Browse the repository at this point in the history
Cast upload file path to string
  • Loading branch information
seth-reeser committed Jun 17, 2016
2 parents 5597482 + c7f4680 commit 4e2954a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/vagrant-hostmanager/hosts_file/updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ def initialize(global_env, provider)
@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)
Expand All @@ -29,10 +31,14 @@ def update_guest(machine)
# 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
Expand Down

0 comments on commit 4e2954a

Please sign in to comment.