Force removal of rsync tmp dir

Force delete entry to prevent any potentail failures when trying to
clean up the tmp dir from rsync
This commit is contained in:
Brian Cain 2019-02-26 09:08:56 -08:00
parent 401a571642
commit 3b540e502f
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
2 changed files with 3 additions and 3 deletions

View File

@ -234,7 +234,7 @@ module VagrantPlugins
end
end
ensure
FileUtils.remove_entry_secure(controlpath) if controlpath
FileUtils.remove_entry_secure(controlpath, true) if controlpath
end
# Check if rsync versions support using chown option

View File

@ -292,7 +292,7 @@ describe VagrantPlugins::SyncedFolderRSync::RsyncHelper do
expect(args[9]).to include("ControlPath=/tmp/vagrant-rsync-12345")
}.and_return(result)
expect(FileUtils).to receive(:remove_entry_secure).with("/tmp/vagrant-rsync-12345").and_return(true)
expect(FileUtils).to receive(:remove_entry_secure).with("/tmp/vagrant-rsync-12345", true).and_return(true)
subject.rsync_single(machine, ssh_info, opts)
end
@ -305,7 +305,7 @@ describe VagrantPlugins::SyncedFolderRSync::RsyncHelper do
expect(args).not_to include("ControlPath=/tmp/vagrant-rsync-12345")
}.and_return(result)
expect(FileUtils).not_to receive(:remove_entry_secure).with("/tmp/vagrant-rsync-12345")
expect(FileUtils).not_to receive(:remove_entry_secure).with("/tmp/vagrant-rsync-12345", true)
subject.rsync_single(machine, ssh_info, opts)
end
end