Retain tmp hosts file and fix a bug where powershell mv does not move folder contents, in that context it's moving a file.

This commit is contained in:
Seth Reeser 2015-08-06 10:39:06 -04:00
parent 302337b467
commit bb53e420ae
1 changed files with 5 additions and 6 deletions

View File

@ -36,14 +36,13 @@ module VagrantPlugins
# upload modified file and remove temporary file
machine.communicate.upload(file, '/tmp/hosts')
machine.communicate.sudo("#{move_cmd} /tmp/hosts #{realhostfile}")
if windir
machine.communicate.sudo("#{move_cmd} /tmp/hosts/hosts.#{machine.name} #{realhostfile}")
else
machine.communicate.sudo("#{move_cmd} /tmp/hosts #{realhostfile}")
end
end
# i have no idea if this is a windows competibility issue or not, but sometimes it dosen't work on my machine
begin
FileUtils.rm(file)
rescue Exception => e
end
end
def update_host