class VagrantPlugins::VSphere::Provider

Public Class Methods

new(machine) click to toggle source
# File lib/vSphere/provider.rb, line 6
def initialize(machine)
  @machine = machine
end

Public Instance Methods

action(name) click to toggle source
# File lib/vSphere/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() click to toggle source
# File lib/vSphere/provider.rb, line 16
def ssh_info
  env = @machine.action('get_ssh_info')
  env[:machine_ssh_info]
end
state() click to toggle source
# File lib/vSphere/provider.rb, line 21
def state
  env = @machine.action('get_state')

  state_id = env[:machine_state_id]

  short = "vagrant_vsphere.states.short_#{state_id}"
  long  = "vagrant_vsphere.states.long_#{state_id}"

  # Return the MachineState object
  Vagrant::MachineState.new(state_id, short, long)
end
to_s() click to toggle source
# File lib/vSphere/provider.rb, line 33
def to_s
  id = @machine.id.nil? ? 'new' : @machine.id
  "vSphere (#{id})"
end