class HashiCorp::VagrantVMwareDesktop::Action::WaitForCommunicatorCompat

Public Class Methods

new(app, env) click to toggle source
# File lib/vagrant-vmware-desktop/action/wait_for_communicator_compat.rb, line 7
def initialize(app, env)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/vagrant-vmware-desktop/action/wait_for_communicator_compat.rb, line 11
def call(env)
  env[:ui].info(
    I18n.t("hashicorp.vagrant_vmware_desktop.waiting_for_boot"))
  while true
    # If we're interrupted then just back out
    return if env[:interrupted]

    if env[:machine].communicate.ready?
      env[:ui].info(I18n.t(
        "hashicorp.vagrant_vmware_desktop.booted_and_ready"))
      break
    end

    sleep 2
  end

  @app.call(env)
end