From e71e88733122e80736600fa8fe141382e7398459 Mon Sep 17 00:00:00 2001 From: sophia Date: Fri, 3 Dec 2021 17:09:34 -0600 Subject: [PATCH] Move remote synced folder module into remote plugin module --- lib/vagrant/plugin.rb | 1 + lib/vagrant/plugin/remote.rb | 10 ++++++++++ lib/vagrant/plugin/remote/plugin.rb | 9 +++++++++ .../remote.rb => remote/synced_folder.rb} | 10 ++++++---- lib/vagrant/shared_helpers.rb | 2 +- 5 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 lib/vagrant/plugin/remote.rb create mode 100644 lib/vagrant/plugin/remote/plugin.rb rename lib/vagrant/plugin/{v2/synced_folder/remote.rb => remote/synced_folder.rb} (95%) diff --git a/lib/vagrant/plugin.rb b/lib/vagrant/plugin.rb index 66dcbdbec..b7a7a0735 100644 --- a/lib/vagrant/plugin.rb +++ b/lib/vagrant/plugin.rb @@ -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 diff --git a/lib/vagrant/plugin/remote.rb b/lib/vagrant/plugin/remote.rb new file mode 100644 index 000000000..ea583e1ee --- /dev/null +++ b/lib/vagrant/plugin/remote.rb @@ -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 diff --git a/lib/vagrant/plugin/remote/plugin.rb b/lib/vagrant/plugin/remote/plugin.rb new file mode 100644 index 000000000..049f066fd --- /dev/null +++ b/lib/vagrant/plugin/remote/plugin.rb @@ -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 diff --git a/lib/vagrant/plugin/v2/synced_folder/remote.rb b/lib/vagrant/plugin/remote/synced_folder.rb similarity index 95% rename from lib/vagrant/plugin/v2/synced_folder/remote.rb rename to lib/vagrant/plugin/remote/synced_folder.rb index c062bacf7..32349c3a3 100644 --- a/lib/vagrant/plugin/v2/synced_folder/remote.rb +++ b/lib/vagrant/plugin/remote/synced_folder.rb @@ -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 diff --git a/lib/vagrant/shared_helpers.rb b/lib/vagrant/shared_helpers.rb index 9d195e23f..7c25479ea 100644 --- a/lib/vagrant/shared_helpers.rb +++ b/lib/vagrant/shared_helpers.rb @@ -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