Class: VagrantPlugins::Skytap::Action::AddVmToEnvironment
- Defined in:
- lib/vagrant-skytap/action/add_vm_to_environment.rb
Overview
Adds the specified vm to this Skytap environment, assuming the vm and environment both exist.
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ AddVmToEnvironment
constructor
A new instance of AddVmToEnvironment.
- #vm_url ⇒ Object
Constructor Details
#initialize(app, env) ⇒ AddVmToEnvironment
Returns a new instance of AddVmToEnvironment.
14 15 16 17 18 |
# File 'lib/vagrant-skytap/action/add_vm_to_environment.rb', line 14 def initialize(app, env) @app = app @env = env @logger = Log4r::Logger.new("vagrant_skytap::action::add_vm_to_environment") end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
12 13 14 |
# File 'lib/vagrant-skytap/action/add_vm_to_environment.rb', line 12 def env @env end |
Instance Method Details
#call(env) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/vagrant-skytap/action/add_vm_to_environment.rb', line 20 def call(env) environment = env[:environment] vm = environment.add_vm(vm_url) env[:machine].id = vm.id environment.wait_until_ready @app.call(env) end |
#vm_url ⇒ Object
29 30 31 |
# File 'lib/vagrant-skytap/action/add_vm_to_environment.rb', line 29 def vm_url env[:machine].provider_config.vm_url end |