Add guest remote plugin module

This commit is contained in:
sophia 2022-02-03 16:21:01 -06:00 committed by Paul Hinze
parent 8911ebd2b7
commit 56edbfa3b8
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
2 changed files with 31 additions and 0 deletions

View File

@ -4,6 +4,7 @@ module Vagrant
module Plugin
module Remote
autoload :Communicator, "vagrant/plugin/remote/communicator"
autoload :Guest, "vagrant/plugin/remote/guest"
autoload :Manager, "vagrant/plugin/remote/manager"
autoload :Plugin, "vagrant/plugin/remote/plugin"
autoload :Provider, "vagrant/plugin/remote/provider"

View File

@ -0,0 +1,30 @@
module Vagrant
module Plugin
module Remote
class Guest
# This module enables Guest for server mode
module Remote
# Add an attribute accesor for the client
# when applied to the Guest class
def self.prepended(klass)
klass.class_eval do
attr_accessor :client
end
end
def initialize(machine)
@logger = Log4r::Logger.new("vagrant::remote::guest")
@logger.debug("initializing guest with remote backend")
@machine = machine
@client = machine.client.guest
end
def detect?(machine)
@client.detect(machine)
end
end
end
end
end
end