core: don't delete data dir if no data dir [GH-4017]
This commit is contained in:
parent
0a5f6bb77e
commit
4f0e527f5d
|
@ -6,6 +6,7 @@ IMPROVEMENTS:
|
||||||
|
|
||||||
BUG FIXES:
|
BUG FIXES:
|
||||||
|
|
||||||
|
- commands/package: base package won't crash with exception [GH-4017]
|
||||||
- hosts/windows: RDP command works without crash. [GH-3962]
|
- hosts/windows: RDP command works without crash. [GH-3962]
|
||||||
- provisioners/puppet: Properly escape facter variables for PowerShell
|
- provisioners/puppet: Properly escape facter variables for PowerShell
|
||||||
on Windows guests. [GH-3959]
|
on Windows guests. [GH-3959]
|
||||||
|
|
|
@ -301,13 +301,15 @@ module Vagrant
|
||||||
@env.machine_index.delete(entry) if entry
|
@env.machine_index.delete(entry) if entry
|
||||||
end
|
end
|
||||||
|
|
||||||
# Delete the entire data directory contents since all state
|
if @data_dir
|
||||||
# associated with the VM is now gone.
|
# Delete the entire data directory contents since all state
|
||||||
@data_dir.children.each do |child|
|
# associated with the VM is now gone.
|
||||||
begin
|
@data_dir.children.each do |child|
|
||||||
child.rmtree
|
begin
|
||||||
rescue Errno::EACCES
|
child.rmtree
|
||||||
@logger.info("EACCESS deleting file: #{child}")
|
rescue Errno::EACCES
|
||||||
|
@logger.info("EACCESS deleting file: #{child}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue