core: don't delete data dir if no data dir [GH-4017]

This commit is contained in:
Mitchell Hashimoto 2014-06-12 11:30:10 -07:00
parent 0a5f6bb77e
commit 4f0e527f5d
2 changed files with 10 additions and 7 deletions

View File

@ -6,6 +6,7 @@ IMPROVEMENTS:
BUG FIXES:
- commands/package: base package won't crash with exception [GH-4017]
- hosts/windows: RDP command works without crash. [GH-3962]
- provisioners/puppet: Properly escape facter variables for PowerShell
on Windows guests. [GH-3959]

View File

@ -301,6 +301,7 @@ module Vagrant
@env.machine_index.delete(entry) if entry
end
if @data_dir
# Delete the entire data directory contents since all state
# associated with the VM is now gone.
@data_dir.children.each do |child|
@ -311,6 +312,7 @@ module Vagrant
end
end
end
end
# Store the ID locally
@id = value.nil? ? nil : value.to_s