Class: VagrantPlugins::XenServer::Provider
- Inherits:
-
Object
- Object
- VagrantPlugins::XenServer::Provider
- Defined in:
- lib/vagrant-xenserver/provider.rb
Instance Method Summary collapse
- #action(name) ⇒ Object
-
#initialize(machine) ⇒ Provider
constructor
A new instance of Provider.
- #ssh_info ⇒ Object
- #state ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(machine) ⇒ Provider
Returns a new instance of Provider.
6 7 8 |
# File 'lib/vagrant-xenserver/provider.rb', line 6 def initialize(machine) @machine = machine end |
Instance Method Details
#action(name) ⇒ Object
10 11 12 13 14 |
# File 'lib/vagrant-xenserver/provider.rb', line 10 def action(name) action_method = "action_#{name}" return Action.send(action_method) if Action.respond_to?(action_method) nil end |
#ssh_info ⇒ Object
16 17 18 19 |
# File 'lib/vagrant-xenserver/provider.rb', line 16 def ssh_info env = @machine.action('read_ssh_info', lock: false) env[:machine_ssh_info] end |
#state ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/vagrant-xenserver/provider.rb', line 21 def state env = @machine.action("read_state", lock: false) state_id = env[:machine_state_id] Vagrant::MachineState.new(state_id, state_id, state_id) end |
#to_s ⇒ Object
29 30 31 32 |
# File 'lib/vagrant-xenserver/provider.rb', line 29 def to_s id = @machine.id.nil? ? "new" : @machine.id "XenServer (#{id})" end |