From 32c9707aa102f75ecda090e8c6cce5ef3d7ba092 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 15 Apr 2014 13:45:23 -0700 Subject: [PATCH] core: MachineIndex cleans up machine lock files --- lib/vagrant/machine_index.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/vagrant/machine_index.rb b/lib/vagrant/machine_index.rb index 6a30a4e60..02090210d 100644 --- a/lib/vagrant/machine_index.rb +++ b/lib/vagrant/machine_index.rb @@ -271,6 +271,12 @@ module Vagrant lock_file = @machine_locks[id] if lock_file lock_file.close + begin + File.delete(lock_file.path) + rescue Errno::EACCES + # Another process is probably opened it, no problem. + end + @machine_locks.delete(id) end end