module Vagrant::Host::Remote

This module enables Host for server mode

Public Class Methods

new(host, hosts, capabilities, env) click to toggle source

@param [] host client @param hosts - unused @param capabilities - unused @param [Vagrant::Environment]

# File lib/vagrant/host/remote.rb, line 18
def initialize(host, hosts, capabilities, env)
  @env = env
  @client = host
  @logger = Log4r::Logger.new("vagrant::host")
end
prepended(klass) click to toggle source

Add an attribute accesor for the client when applied to the Guest class

# File lib/vagrant/host/remote.rb, line 8
def self.prepended(klass)
  klass.class_eval do
    attr_accessor :client
  end
end

Public Instance Methods

capability(cap_name, *args) click to toggle source

Executes the capability with the given name, optionally passing more arguments onwards to the capability. If the capability returns a value, it will be returned.

@param [Symbol] cap_name Name of the capability

# File lib/vagrant/host/remote.rb, line 33
def capability(cap_name, *args)
  @logger.debug("running remote host capability #{cap_name} with args #{args}")
  client.capability(cap_name, *args)
end
capability?(cap_name) click to toggle source

Tests whether the given capability is possible.

@param [Symbol] cap_name Capability name @return [Boolean]

# File lib/vagrant/host/remote.rb, line 42
def capability?(cap_name)
  @logger.debug("checking for remote host capability #{cap_name}")
  client.has_capability?(cap_name)
end
initialize_capabilities!(host, hosts, capabilities, *args) click to toggle source
# File lib/vagrant/host/remote.rb, line 24
def initialize_capabilities!(host, hosts, capabilities, *args)
  # no-op
end
to_proto() click to toggle source
# File lib/vagrant/host/remote.rb, line 47
def to_proto
  client.proto
end