Remove tmpdir after rsync completes

This commit is contained in:
Andrew Eikum 2019-01-07 09:01:51 -06:00 committed by Brian Cain
parent 1d25480e23
commit 7517faa9ee
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,4 @@
require "fileutils"
require "ipaddr"
require "shellwords"
require "tmpdir"
@ -232,6 +233,8 @@ module VagrantPlugins
message: err.to_s
end
end
ensure
FileUtils.remove_entry_secure(controlpath) if controlpath
end
# Check if rsync versions support using chown option

View File

@ -293,6 +293,10 @@ describe VagrantPlugins::SyncedFolderRSync::RsyncHelper do
}.and_return(result)
subject.rsync_single(machine, ssh_info, opts)
unless Vagrant::Util::Platform.windows?
expect(File.exist?("/tmp/vagrant-rsync-12345")).to be_falsey
end
end
end
end