Class: VagrantPlugins::Deltacloud::Action::StartServer

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

Instance Method Summary collapse

Methods inherited from AbstractAction

#call

Constructor Details

#initialize(app, _env) ⇒ StartServer

Returns a new instance of StartServer.



10
11
12
13
# File 'lib/vagrant-deltacloud-provider/action/start_server.rb', line 10

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

Instance Method Details

#execute(env) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/vagrant-deltacloud-provider/action/start_server.rb', line 15

def execute(env)
  env[:deltacloud_client] = Deltacloud::DeltacloudClient.instance
  if env[:machine].id
    env[:ui].info(I18n.t('vagrant_deltacloud.starting_server'))
    env[:deltacloud_client].start_instance(env, env[:machine].id)
  end
  @app.call(env)
end