Class: VagrantPlugins::CORL::Action::DeleteCache

Inherits:
BaseAction
  • Object
show all
Defined in:
lib/core/vagrant/actions/delete_cache.rb

Instance Attribute Summary

Attributes inherited from BaseAction

#network, #node, #vm

Instance Method Summary collapse

Methods inherited from BaseAction

#initialize

Constructor Details

This class inherits a constructor from VagrantPlugins::CORL::BaseAction

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/core/vagrant/actions/delete_cache.rb', line 7

def call(env)
  super do
    @app.call env
    
    env[:ui].info I18n.t("corl.vagrant.actions.delete_cache.start")
    
    # Check for saved image
    box     = node.cache_setting(:box)
    box_url = node.cache_setting(:box_url)
    
    # Clear cache unless saved image
    node.clear_cache unless box && box_url
  end
end