Class: VagrantPlugins::Skytap::Action::RunEnvironment
- Includes:
- Vagrant::Util::Retryable
- Defined in:
- lib/vagrant-skytap/action/run_environment.rb
Overview
Runs the Skytap environment and waits until running.
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #call(env) ⇒ Object
- #environment ⇒ Object
-
#initialize(app, env) ⇒ RunEnvironment
constructor
A new instance of RunEnvironment.
- #wait_for_ssh_ready ⇒ Object
Constructor Details
#initialize(app, env) ⇒ RunEnvironment
24 25 26 27 28 |
# File 'lib/vagrant-skytap/action/run_environment.rb', line 24 def initialize(app, env) @app = app @env = env @logger = Log4r::Logger.new("vagrant_skytap::action::run_environment") end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
22 23 24 |
# File 'lib/vagrant-skytap/action/run_environment.rb', line 22 def env @env end |
Instance Method Details
#call(env) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/vagrant-skytap/action/run_environment.rb', line 30 def call(env) env[:ui].info(I18n.t("vagrant_skytap.launching_instance")) environment.run! wait_for_ssh_ready @app.call(env) end |
#environment ⇒ Object
40 41 42 |
# File 'lib/vagrant-skytap/action/run_environment.rb', line 40 def environment env[:environment] end |
#wait_for_ssh_ready ⇒ Object
44 45 46 47 48 49 |
# File 'lib/vagrant-skytap/action/run_environment.rb', line 44 def wait_for_ssh_ready loop do break if env[:interrupted] || env[:machine].communicate.ready? sleep 1 end end |