Class: VagrantPlugins::VCloud::Action::Resume

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-vcloud/action/resume.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Resume

Returns a new instance of Resume.


5
6
7
8
# File 'lib/vagrant-vcloud/action/resume.rb', line 5

def initialize(app, env)
  @app = app
  @logger = Log4r::Logger.new('vagrant_vcloud::action::resume')
end

Instance Method Details

#call(env) ⇒ Object


10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/vagrant-vcloud/action/resume.rb', line 10

def call(env)
  cfg = env[:machine].provider_config
  cnx = cfg.vcloud_cnx.driver

  vm_id = env[:machine].id

  env[:ui].info('Powering on VM...')
  task_id = cnx.poweron_vm(vm_id)
  cnx.wait_task_completion(task_id)

  @app.call env
end