Class: Vagrant::Butcher::Action::Cleanup
- Inherits:
-
Object
- Object
- Vagrant::Butcher::Action::Cleanup
- Includes:
- Helpers::Action, Helpers::Connection
- Defined in:
- lib/vagrant-butcher/action/cleanup.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ Cleanup
constructor
A new instance of Cleanup.
Methods included from Helpers::Connection
#cleanup, #delete_resource, #setup_connection
Methods included from Helpers::KeyFiles
#cache_dir, #cleanup_cache_dir, #client_key_path, #copy_guest_key, #create_cache_dir, #grab_key_from_guest, #guest_key_path, #key_filename
Methods included from Helpers::Guest
#get_guest_key_path, #windows?
Methods included from Helpers::Action
Methods included from Helpers::Config
#butcher_config, #chef_client?, #chef_provisioner, #client_name, #victim, #vm_config
Constructor Details
#initialize(app, env) ⇒ Cleanup
Returns a new instance of Cleanup.
8 9 10 |
# File 'lib/vagrant-butcher/action/cleanup.rb', line 8 def initialize(app, env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/vagrant-butcher/action/cleanup.rb', line 12 def call(env) if butcher_config(machine(env)).enabled cleanup(env) else env[:ui].warn "Vagrant::Butcher disabled, not cleaning up Chef server!" end @app.call(env) end |