Class: VagrantPlugins::Openstack::Action::StartServer

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-openstack-provider/action/start_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, _env) ⇒ StartServer

Returns a new instance of StartServer.



7
8
9
10
# File 'lib/vagrant-openstack-provider/action/start_server.rb', line 7

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

Instance Method Details

#call(env) ⇒ Object



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

def call(env)
  if env[:machine].id
    env[:ui].info(I18n.t('vagrant_openstack.starting_server'))
    env[:openstack_client].nova.start_server(env, env[:machine].id)
  end
  @app.call(env)
end