mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-05-28 04:36:05 -04:00
core: clean up machine directory when id = nil
This commit is contained in:
parent
a96efcdec9
commit
4608e75b48
1 changed files with 6 additions and 0 deletions
|
|
@ -207,6 +207,12 @@ module Vagrant
|
|||
else
|
||||
# Delete the file, since the machine is now destroyed
|
||||
id_file.delete if id_file.file?
|
||||
|
||||
# Delete the entire data directory contents since all state
|
||||
# associated with the VM is now gone.
|
||||
@data_dir.children.each do |child|
|
||||
child.rmtree
|
||||
end
|
||||
end
|
||||
|
||||
# Store the ID locally
|
||||
|
|
|
|||
Loading…
Reference in a new issue