Class: VagrantPlugins::Deltacloud::Action::WaitForServerToBeAccessible

Inherits:
AbstractAction
  • Object
show all
Includes:
Command::Utils
Defined in:
lib/vagrant-deltacloud-provider/action/wait_accessible.rb

Instance Method Summary collapse

Methods included from Command::Utils

#display_item_list, #display_table, #get_ip_address

Methods inherited from AbstractAction

#call

Constructor Details

#initialize(app, env, resolver = nil, ssh = nil) ⇒ WaitForServerToBeAccessible

Returns a new instance of WaitForServerToBeAccessible.



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

def initialize(app, env, resolver = nil, ssh = nil)
  @logger   = Log4r::Logger.new('vagrant_deltacloud::action::wait_accessible')
  @app      = app
  @ssh      = ssh || Vagrant::Action::Builtin::SSHRun.new(app, env)
  @resolver = resolver || VagrantPlugins::Deltacloud::ConfigResolver.new
end

Instance Method Details

#execute(env) ⇒ Object



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

def execute(env)
  env[:deltacloud_client] = Deltacloud::DeltacloudClient.instance
  waiting_for_server_to_be_reachable(env)
  @logger.info 'The server is ready'
  env[:ui].info(I18n.t('vagrant_deltacloud.ready'))
  @app.call(env)
end