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:
|
||||
|
||||
- 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]
|
||||
|
|
|
@ -301,13 +301,15 @@ module Vagrant
|
|||
@env.machine_index.delete(entry) if entry
|
||||
end
|
||||
|
||||
# Delete the entire data directory contents since all state
|
||||
# associated with the VM is now gone.
|
||||
@data_dir.children.each do |child|
|
||||
begin
|
||||
child.rmtree
|
||||
rescue Errno::EACCES
|
||||
@logger.info("EACCESS deleting file: #{child}")
|
||||
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|
|
||||
begin
|
||||
child.rmtree
|
||||
rescue Errno::EACCES
|
||||
@logger.info("EACCESS deleting file: #{child}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue