Class: VagrantPlugins::Abiquo::Actions::PowerOn
- Inherits:
-
Object
- Object
- VagrantPlugins::Abiquo::Actions::PowerOn
- Includes:
- Helpers::Abiquo
- Defined in:
- lib/vagrant_abiquo/actions/power_on.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ PowerOn
constructor
A new instance of PowerOn.
Methods included from Helpers::Abiquo
#apply_state, #attach_net, #create_vapp, #create_vm, #deploy, #get_network, #get_template, #get_vapp, #get_vdc, #get_vm, #poweroff, #poweron, #reset, #update, #vapp_name
Constructor Details
#initialize(app, env) ⇒ PowerOn
Returns a new instance of PowerOn.
9 10 11 12 13 |
# File 'lib/vagrant_abiquo/actions/power_on.rb', line 9 def initialize(app, env) @app = app @machine = env[:machine] @logger = Log4r::Logger.new('vagrant::abiquo::power_on') end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/vagrant_abiquo/actions/power_on.rb', line 15 def call(env) vm = get_vm(client, @machine.id) vm = poweron(client, vm) raise PowerOnError, vm: vm.label, state: vm.state if vm.state != 'ON' @app.call(env) end |