Class: VagrantPlugins::SoftLayer::Action::DestroyInstance

Inherits:
Object
  • Object
show all
Includes:
Util::Warden
Defined in:
lib/vagrant-softlayer/action/destroy_instance.rb

Overview

This deletes the running instance.

Instance Method Summary collapse

Methods included from Util::Warden

#sl_warden

Constructor Details

#initialize(app, env) ⇒ DestroyInstance

Returns a new instance of DestroyInstance.



8
9
10
# File 'lib/vagrant-softlayer/action/destroy_instance.rb', line 8

def initialize(app, env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/vagrant-softlayer/action/destroy_instance.rb', line 12

def call(env)
  env[:ui].info I18n.t("vagrant_softlayer.vm.destroying")
  
  sl_warden { env[:sl_machine].deleteObject }
  env[:machine].id = nil

  @app.call(env)
end