Class: VagrantLXD::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-lxd/provider.rb

Instance Method Summary collapse

Constructor Details

#initialize(machine) ⇒ Provider

Returns a new instance of Provider.



24
25
26
27
# File 'lib/vagrant-lxd/provider.rb', line 24

def initialize(machine)
  @machine = machine
  @driver = Driver.new(machine)
end

Instance Method Details

#action(name) ⇒ Object



29
30
31
# File 'lib/vagrant-lxd/provider.rb', line 29

def action(name)
  Action.send(name) if Action.respond_to?(name)
end

#ssh_infoObject



40
41
42
# File 'lib/vagrant-lxd/provider.rb', line 40

def ssh_info
  @driver.info
end

#stateObject



33
34
35
36
37
38
# File 'lib/vagrant-lxd/provider.rb', line 33

def state
  state = @driver.tap { |d| d.validate! }.state
  short = state.to_s.gsub('_', ' ')
  long = I18n.t("vagrant.commands.status.#{state}")
  Vagrant::MachineState.new(state, short, long)
end

#to_sObject



44
45
46
# File 'lib/vagrant-lxd/provider.rb', line 44

def to_s
  'LXD'
end