Class: VagrantPlugins::Openstack::Action::Resume

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-openstack-provider/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-openstack-provider/action/resume.rb', line 5

def initialize(app, _env)
  @app = app
  @logger = Log4r::Logger.new('vagrant_openstack::action::resume_server')
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/vagrant-openstack-provider/action/resume.rb', line 10

def call(env)
  if env[:machine].id
    @logger.info "Resuming suspended VM #{env[:machine].id}..."
    env[:ui].info I18n.t('vagrant.actions.vm.resume.resuming')
    env[:openstack_client].nova.resume_server(env, env[:machine].id)
  end

  @app.call(env)
end