Class: VagrantPlugins::Utm::Action::WaitForRunning

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant_utm/action/wait_for_running.rb

Overview

This action waits for a given amount of seconds. This is a workaround for the UTM provider, which does not report when the VM is running. As soon as UTM reports the state as ‘running’, this action can and will be removed. Then we use the state ‘running’, rather than ‘started’

Instance Method Summary collapse

Constructor Details

#initialize(app, _env) ⇒ WaitForRunning

Returns a new instance of WaitForRunning.



12
13
14
# File 'lib/vagrant_utm/action/wait_for_running.rb', line 12

def initialize(app, _env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/vagrant_utm/action/wait_for_running.rb', line 16

def call(env)
  # set the wait time to user configured time or
  # default time.
  wait_time = env[:machine].provider_config.wait_time
  env[:ui].info I18n.t("vagrant_utm.messages.waiting_for_vm", time: wait_time)
  sleep(wait_time)

  @app.call(env)
end