require "log4r" require 'json' require 'vagrant/util/retryable' require 'vagrant-skytap/util/timer' require 'vagrant-skytap/api/environment' require 'net/https' require 'uri' require 'base64' require 'json' require 'timeout' module VagrantPlugins module Skytap module Action # Runs the Skytap VM and waits until running. class RunVm include Vagrant::Util::Retryable attr_reader :env def initialize(app, env) @app = app @env = env @logger = Log4r::Logger.new("vagrant_skytap::action::run_vm") end def call(env) env[:ui].info(I18n.t("vagrant_skytap.launching_vm")) environment.current_vm.run! wait_for_ssh_ready @app.call(env) end def environment env[:environment] end def wait_for_ssh_ready loop do break if env[:interrupted] || env[:machine].communicate.ready? sleep 1 end end end end end end