Let users know we will attempt to remove symlinks, otherwise vagrant won't output anything prior to the warn
This commit is contained in:
parent
199a14b61f
commit
cfabddc7c8
1 changed files with 7 additions and 8 deletions
|
@ -13,11 +13,13 @@ module VagrantPlugins
|
||||||
@env = env
|
@env = env
|
||||||
@machine = env[:machine]
|
@machine = env[:machine]
|
||||||
|
|
||||||
if should_remove_symlinks?
|
if symlinks.any?
|
||||||
env[:ui].info I18n.t('vagrant_cachier.cleanup')
|
env[:ui].info I18n.t('vagrant_cachier.cleanup')
|
||||||
|
if sshable?
|
||||||
symlinks.each do |symlink|
|
symlinks.each do |symlink|
|
||||||
remove_symlink symlink
|
remove_symlink symlink
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
File.delete @machine.data_dir.join('cache_dirs').to_s
|
File.delete @machine.data_dir.join('cache_dirs').to_s
|
||||||
end
|
end
|
||||||
|
@ -25,12 +27,9 @@ module VagrantPlugins
|
||||||
@app.call env
|
@app.call env
|
||||||
end
|
end
|
||||||
|
|
||||||
def should_remove_symlinks?
|
|
||||||
@logger.info 'Checking if cache symlinks should be removed'
|
|
||||||
symlinks.any? && @machine.state.id == :running && sshable?
|
|
||||||
end
|
|
||||||
|
|
||||||
def sshable?
|
def sshable?
|
||||||
|
return if @machine.state.id != :running
|
||||||
|
|
||||||
# By default Vagrant will keep trying [1] to ssh connect to the VM for
|
# By default Vagrant will keep trying [1] to ssh connect to the VM for
|
||||||
# a long and we've got to prevent that from happening, so we just wait
|
# a long and we've got to prevent that from happening, so we just wait
|
||||||
# a few seconds and assume that the VM is halted / unresponsive and we
|
# a few seconds and assume that the VM is halted / unresponsive and we
|
||||||
|
|
Loading…
Reference in a new issue