module Kitchen::Driver::Lxd::HostLocator

Public Instance Methods

can_rest?() click to toggle source
# File lib/kitchen/driver/lxd/host_locator.rb, line 23
def can_rest?
  config[:server] && !config[:server].empty?
end
driver() click to toggle source
# File lib/kitchen/driver/lxd/host_locator.rb, line 8
def driver
  @driver ||= nx_driver
end
host_address() click to toggle source
# File lib/kitchen/driver/lxd/host_locator.rb, line 27
def host_address
  "https://#{config[:server]}:#{config[:port]}"
end
nx_driver() click to toggle source
# File lib/kitchen/driver/lxd/host_locator.rb, line 12
def nx_driver
  return ::NexusSW::LXD::Driver::CLI.new(::NexusSW::LXD::Transport::Local.new) unless can_rest?
  ::NexusSW::LXD::Driver::Rest.new(host_address, config[:rest_options])
end
nx_transport(state) click to toggle source
# File lib/kitchen/driver/lxd/host_locator.rb, line 17
def nx_transport(state)
  driver.transport_for(state[:container_name]).tap do |transport|
    transport.user state[:username] if state.key? :username
  end
end