Move remote synced folder module into remote plugin module

This commit is contained in:
sophia 2021-12-03 17:09:34 -06:00 committed by Paul Hinze
parent 3a43cd35cb
commit e71e887331
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
5 changed files with 27 additions and 5 deletions

View File

@ -2,6 +2,7 @@ module Vagrant
module Plugin
autoload :V1, "vagrant/plugin/v1"
autoload :V2, "vagrant/plugin/v2"
autoload :Remote, "vagrant/plugin/remote"
autoload :Manager, "vagrant/plugin/manager"
autoload :StateFile, "vagrant/plugin/state_file"
end

View File

@ -0,0 +1,10 @@
require "log4r"
module Vagrant
module Plugin
module Remote
autoload :Plugin, "vagrant/plugin/remote/plugin"
autoload :SyncedFolder, "vagrant/plugin/remote/synced_folder"
end
end
end

View File

@ -0,0 +1,9 @@
module Vagrant
module Plugin
module Remote
# This is the wrapper class for all Remote plugins.
class Plugin
end
end
end
end

View File

@ -1,6 +1,6 @@
module Vagrant
module Plugin
module V2
module Remote
class SyncedFolder
# This module enables SyncedFolder for server mode
module Remote
@ -13,14 +13,16 @@ module Vagrant
end
end
def _initialize(machine, synced_folder_type, client=nil)
@machine = machine
def initialize(client=nil)
@client = client
if @client.nil?
raise ArgumentError,
"Remote client is required for `#{self.class.name}'"
end
@logger = Log4r::Logger.new("vagrant::synced_folder")
@logger = Log4r::Logger.new("vagrant::remote::synced_folder")
end
def _initialize(machine, synced_folder_type, client=nil)
self
end

View File

@ -267,6 +267,6 @@ module Vagrant
->{ Vagrant::MachineIndex.prepend(Vagrant::MachineIndex::Remote) },
->{ Vagrant::MachineIndex::Entry.prepend(Vagrant::MachineIndex::Entry::Remote::InstanceMethods) },
->{ Vagrant::MachineIndex::Entry.extend(Vagrant::MachineIndex::Entry::Remote::ClassMethods) },
->{ Vagrant::Plugin::V2::SyncedFolder.prepend(Vagrant::Plugin::V2::SyncedFolder::Remote) },
->{ Vagrant::Plugin::V2::SyncedFolder.prepend(Vagrant::Plugin::Remote::SyncedFolder::Remote) },
].freeze
end