Class: VagrantPlugins::Skytap::Action::DeleteEnvironment

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-skytap/action/delete_environment.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ DeleteEnvironment

Deletes Skytap environment, cleans up data files, and removes the remaining VM from the global machine index.


7
8
9
10
# File 'lib/vagrant-skytap/action/delete_environment.rb', line 7

def initialize(app, env)
  @app = app
  @logger = Log4r::Logger.new("vagrant_skytap::action::delete_environment")
end

Instance Method Details

#call(env) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
# File 'lib/vagrant-skytap/action/delete_environment.rb', line 12

def call(env)
  url_file = env[:machine].env.local_data_path.join('environment')
  url_file.delete if url_file.exist?

  if env[:environment]
    env[:environment].delete
  end
  env[:machine].id = nil

  @app.call(env)
end