Class: VagrantPlugins::SoftLayer::Action::SuspendInstance

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

Overview

This suspends the running instance.

Instance Method Summary collapse

Methods included from Util::Warden

#sl_warden

Constructor Details

#initialize(app, env) ⇒ SuspendInstance

Returns a new instance of SuspendInstance.



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

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

Instance Method Details

#call(env) ⇒ Object



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

def call(env)
  env[:ui].info I18n.t("vagrant_softlayer.vm.suspending")
  sl_warden { env[:sl_machine].pause }
  
  @app.call(env)
end