From ab395ad730cae7ca87b4ef1eeffce4048c1c6a86 Mon Sep 17 00:00:00 2001 From: sophia Date: Wed, 8 Dec 2021 10:49:38 -0600 Subject: [PATCH] Move remote communicator to remote plugin module --- lib/vagrant/plugin/remote.rb | 1 + .../{v2/communicator/remote.rb => remote/communicator.rb} | 4 ++-- lib/vagrant/plugin/v2/communicator.rb | 2 +- lib/vagrant/shared_helpers.rb | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) rename lib/vagrant/plugin/{v2/communicator/remote.rb => remote/communicator.rb} (95%) diff --git a/lib/vagrant/plugin/remote.rb b/lib/vagrant/plugin/remote.rb index ea583e1ee..95277634d 100644 --- a/lib/vagrant/plugin/remote.rb +++ b/lib/vagrant/plugin/remote.rb @@ -3,6 +3,7 @@ require "log4r" module Vagrant module Plugin module Remote + autoload :Communicator, "vagrant/plugin/remote/communicator" autoload :Plugin, "vagrant/plugin/remote/plugin" autoload :SyncedFolder, "vagrant/plugin/remote/synced_folder" end diff --git a/lib/vagrant/plugin/v2/communicator/remote.rb b/lib/vagrant/plugin/remote/communicator.rb similarity index 95% rename from lib/vagrant/plugin/v2/communicator/remote.rb rename to lib/vagrant/plugin/remote/communicator.rb index 460ffa0ed..3de0f2f00 100644 --- a/lib/vagrant/plugin/v2/communicator/remote.rb +++ b/lib/vagrant/plugin/remote/communicator.rb @@ -1,6 +1,6 @@ module Vagrant module Plugin - module V2 + module Remote class Communicator # This module enables Communicator for server mode module Remote @@ -14,7 +14,7 @@ module Vagrant end def initialize(machine) - @logger = Log4r::Logger.new("vagrant::communicator") + @logger = Log4r::Logger.new("vagrant::remote::communicator") @logger.debug("initializing communicator with remote baackend") @machine = machine @client = machine.client.communicate diff --git a/lib/vagrant/plugin/v2/communicator.rb b/lib/vagrant/plugin/v2/communicator.rb index c58367f15..2fc1650d6 100644 --- a/lib/vagrant/plugin/v2/communicator.rb +++ b/lib/vagrant/plugin/v2/communicator.rb @@ -17,7 +17,7 @@ module Vagrant # version. class Communicator - autoload :Remote, "vagrant/plugin/v2/communicator/remote" + autoload :Remote, "vagrant/plugin/remote/communicator" # This returns true/false depending on if the given machine # can be communicated with using this communicator. If this returns diff --git a/lib/vagrant/shared_helpers.rb b/lib/vagrant/shared_helpers.rb index 1c1936a52..3cd709384 100644 --- a/lib/vagrant/shared_helpers.rb +++ b/lib/vagrant/shared_helpers.rb @@ -268,6 +268,6 @@ module Vagrant ->{ 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::Remote::SyncedFolder::Remote) }, - ->{ Vagrant::Plugin::V2::Communicator.prepend(Vagrant::Plugin::V2::Communicator::Remote) }, + ->{ Vagrant::Plugin::V2::Communicator.prepend(Vagrant::Plugin::Remote::Communicator::Remote) }, ].freeze end