diff --git a/bin/vagrant b/bin/vagrant index aad4c0436..198078b2c 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -10,16 +10,6 @@ if Thread.respond_to?(:report_on_exception=) Thread.report_on_exception = false end -# Activate all the runtime dependencies before -# moving on. -begin - Gem::Specification.find_by_name("vagrant").runtime_dependencies.each do |dep| - gem(dep.name, dep.requirement.as_list) - end -rescue Gem::MissingSpecError - $stderr.puts "WARN: Failed to locate vagrant specification for dependency loading" -end - # Split arguments by "--" if its there, we'll recombine them later argv = ARGV.dup argv_extra = [] @@ -117,7 +107,6 @@ end env = nil begin - require 'log4r' require 'vagrant' require 'vagrant/bundler' require 'vagrant/cli' diff --git a/lib/vagrant.rb b/lib/vagrant.rb index f790039d3..f670310b3 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -1,14 +1,19 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" + +# Load the shared helpers first to make the custom +# require helper available. +require "vagrant/shared_helpers" + +Vagrant.require "log4r" # Add patches to log4r to support trace level -require "vagrant/patches/log4r" -require "vagrant/patches/net-ssh" -require "vagrant/patches/rubygems" +Vagrant.require "vagrant/patches/log4r" +Vagrant.require "vagrant/patches/net-ssh" +Vagrant.require "vagrant/patches/rubygems" # Set our log levels and include trace -require 'log4r/configurator' +Vagrant.require 'log4r/configurator' Log4r::Configurator.custom_levels(*(["TRACE"] + Log4r::Log4rConfig::LogLevels)) # Update the default formatter within the log4r library to ensure @@ -20,7 +25,7 @@ class Log4r::BasicFormatter end end -require "optparse" +Vagrant.require "optparse" module Vagrant # This is a customized OptionParser for Vagrant plugins. It @@ -45,10 +50,9 @@ module VagrantPlugins end # Load in our helpers and utilities -require "vagrant/shared_helpers" -require "rubygems" -require "vagrant/util" -require "vagrant/plugin/manager" +Vagrant.require "rubygems" +Vagrant.require "vagrant/util" +Vagrant.require "vagrant/plugin/manager" # Enable logging if it is requested. We do this before # anything else so that we can setup the output before @@ -105,19 +109,19 @@ if ENV["VAGRANT_LOG"] && ENV["VAGRANT_LOG"] != "" end end -require 'json' -require 'pathname' -require 'stringio' +Vagrant.require 'json' +Vagrant.require 'pathname' +Vagrant.require 'stringio' -require 'childprocess' -require 'i18n' +Vagrant.require 'childprocess' +Vagrant.require 'i18n' # OpenSSL must be loaded here since when it is loaded via `autoload` # there are issues with ciphers not being properly loaded. -require 'openssl' +Vagrant.require 'openssl' # Always make the version available -require 'vagrant/version' +Vagrant.require 'vagrant/version' global_logger = Log4r::Logger.new("vagrant::global") Vagrant.global_logger = global_logger global_logger.info("Vagrant version: #{Vagrant::VERSION}") @@ -138,7 +142,7 @@ vagrant_ssl_locations = [ if vagrant_ssl_locations.any? { |f| File.exist?(f) } global_logger.debug("vagrant ssl helper found for loading ssl providers") begin - require "vagrant/vagrant_ssl" + Vagrant.require "vagrant/vagrant_ssl" Vagrant.vagrant_ssl_load global_logger.debug("ssl providers successfully loaded") rescue LoadError => err @@ -152,8 +156,8 @@ end # We need these components always so instead of an autoload we # just require them explicitly here. -require "vagrant/plugin" -require "vagrant/registry" +Vagrant.require "vagrant/plugin" +Vagrant.require "vagrant/registry" module Vagrant autoload :Action, 'vagrant/action' @@ -230,7 +234,7 @@ module Vagrant end # Now check the plugin gem names - require "vagrant/plugin/manager" + Vagrant.require "vagrant/plugin/manager" Plugin::Manager.instance.plugin_installed?(name, version) end diff --git a/lib/vagrant/action.rb b/lib/vagrant/action.rb index da987fe8f..d7b82156d 100644 --- a/lib/vagrant/action.rb +++ b/lib/vagrant/action.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'vagrant/action/builder' +Vagrant.require 'vagrant/action/builder' module Vagrant module Action diff --git a/lib/vagrant/action/builtin/box_add.rb b/lib/vagrant/action/builtin/box_add.rb index f04b8b861..38a756b4f 100644 --- a/lib/vagrant/action/builtin/box_add.rb +++ b/lib/vagrant/action/builtin/box_add.rb @@ -1,16 +1,16 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "digest/sha1" -require "log4r" -require "pathname" -require "uri" +Vagrant.require "digest/sha1" +Vagrant.require "log4r" +Vagrant.require "pathname" +Vagrant.require "uri" -require "vagrant/box_metadata" -require "vagrant/util/downloader" -require "vagrant/util/file_checksum" -require "vagrant/util/file_mutex" -require "vagrant/util/platform" +Vagrant.require "vagrant/box_metadata" +Vagrant.require "vagrant/util/downloader" +Vagrant.require "vagrant/util/file_checksum" +Vagrant.require "vagrant/util/file_mutex" +Vagrant.require "vagrant/util/platform" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/box_check_outdated.rb b/lib/vagrant/action/builtin/box_check_outdated.rb index 25f1b9ff4..809113952 100644 --- a/lib/vagrant/action/builtin/box_check_outdated.rb +++ b/lib/vagrant/action/builtin/box_check_outdated.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/box_remove.rb b/lib/vagrant/action/builtin/box_remove.rb index f10328407..55ffaaccb 100644 --- a/lib/vagrant/action/builtin/box_remove.rb +++ b/lib/vagrant/action/builtin/box_remove.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/box_update.rb b/lib/vagrant/action/builtin/box_update.rb index 8f675669a..371b57487 100644 --- a/lib/vagrant/action/builtin/box_update.rb +++ b/lib/vagrant/action/builtin/box_update.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/cleanup_disks.rb b/lib/vagrant/action/builtin/cleanup_disks.rb index 0281142d7..272ada2db 100644 --- a/lib/vagrant/action/builtin/cleanup_disks.rb +++ b/lib/vagrant/action/builtin/cleanup_disks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "json" +Vagrant.require "json" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/cloud_init_setup.rb b/lib/vagrant/action/builtin/cloud_init_setup.rb index 6791ab739..8e05aa73d 100644 --- a/lib/vagrant/action/builtin/cloud_init_setup.rb +++ b/lib/vagrant/action/builtin/cloud_init_setup.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'vagrant/util/mime' -require 'tmpdir' +Vagrant.require 'vagrant/util/mime' +Vagrant.require 'tmpdir' module Vagrant module Action diff --git a/lib/vagrant/action/builtin/cloud_init_wait.rb b/lib/vagrant/action/builtin/cloud_init_wait.rb index 93ef44faa..5d3c46501 100644 --- a/lib/vagrant/action/builtin/cloud_init_wait.rb +++ b/lib/vagrant/action/builtin/cloud_init_wait.rb @@ -1,6 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 +Vagrant.require "log4r" + module Vagrant module Action module Builtin diff --git a/lib/vagrant/action/builtin/config_validate.rb b/lib/vagrant/action/builtin/config_validate.rb index ad315830a..484b62580 100644 --- a/lib/vagrant/action/builtin/config_validate.rb +++ b/lib/vagrant/action/builtin/config_validate.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/util/template_renderer" +Vagrant.require "vagrant/util/template_renderer" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/disk.rb b/lib/vagrant/action/builtin/disk.rb index a6b1e700a..ce9d3b723 100644 --- a/lib/vagrant/action/builtin/disk.rb +++ b/lib/vagrant/action/builtin/disk.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "json" +Vagrant.require "json" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/graceful_halt.rb b/lib/vagrant/action/builtin/graceful_halt.rb index 34b8268be..02119237c 100644 --- a/lib/vagrant/action/builtin/graceful_halt.rb +++ b/lib/vagrant/action/builtin/graceful_halt.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "timeout" +Vagrant.require "log4r" +Vagrant.require "timeout" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/handle_box.rb b/lib/vagrant/action/builtin/handle_box.rb index c28640981..5166f3042 100644 --- a/lib/vagrant/action/builtin/handle_box.rb +++ b/lib/vagrant/action/builtin/handle_box.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "thread" - -require "log4r" +Vagrant.require "thread" +Vagrant.require "log4r" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb b/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb index cb93902bb..c9fa92b72 100644 --- a/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb +++ b/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb @@ -1,13 +1,12 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "set" +Vagrant.require "set" +Vagrant.require "log4r" +Vagrant.require "socket" -require "log4r" -require "socket" - -require "vagrant/util/is_port_open" -require "vagrant/util/ipv4_interfaces" +Vagrant.require "vagrant/util/is_port_open" +Vagrant.require "vagrant/util/ipv4_interfaces" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/lock.rb b/lib/vagrant/action/builtin/lock.rb index 8df79c812..fdba1223c 100644 --- a/lib/vagrant/action/builtin/lock.rb +++ b/lib/vagrant/action/builtin/lock.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/mixin_synced_folders.rb b/lib/vagrant/action/builtin/mixin_synced_folders.rb index 3f33352cf..bf382cd74 100644 --- a/lib/vagrant/action/builtin/mixin_synced_folders.rb +++ b/lib/vagrant/action/builtin/mixin_synced_folders.rb @@ -1,10 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "json" -require "set" - -require 'vagrant/util/scoped_hash_override' +Vagrant.require "json" +Vagrant.require "set" +Vagrant.require 'vagrant/util/scoped_hash_override' module Vagrant module Action diff --git a/lib/vagrant/action/builtin/prepare_clone.rb b/lib/vagrant/action/builtin/prepare_clone.rb index 51fb36b30..bca583480 100644 --- a/lib/vagrant/action/builtin/prepare_clone.rb +++ b/lib/vagrant/action/builtin/prepare_clone.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/provision.rb b/lib/vagrant/action/builtin/provision.rb index 776f6c7dc..591539138 100644 --- a/lib/vagrant/action/builtin/provision.rb +++ b/lib/vagrant/action/builtin/provision.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" require_relative "mixin_provisioners" diff --git a/lib/vagrant/action/builtin/provisioner_cleanup.rb b/lib/vagrant/action/builtin/provisioner_cleanup.rb index 573734b74..2975fac6e 100644 --- a/lib/vagrant/action/builtin/provisioner_cleanup.rb +++ b/lib/vagrant/action/builtin/provisioner_cleanup.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" require_relative "mixin_provisioners" diff --git a/lib/vagrant/action/builtin/set_hostname.rb b/lib/vagrant/action/builtin/set_hostname.rb index b1fe4c38b..d659c104d 100644 --- a/lib/vagrant/action/builtin/set_hostname.rb +++ b/lib/vagrant/action/builtin/set_hostname.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/ssh_exec.rb b/lib/vagrant/action/builtin/ssh_exec.rb index caa4cd45b..0cba24485 100644 --- a/lib/vagrant/action/builtin/ssh_exec.rb +++ b/lib/vagrant/action/builtin/ssh_exec.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" +Vagrant.require "pathname" -require "vagrant/util/ssh" +Vagrant.require "vagrant/util/ssh" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/ssh_run.rb b/lib/vagrant/action/builtin/ssh_run.rb index 7123d23f0..9f9466435 100644 --- a/lib/vagrant/action/builtin/ssh_run.rb +++ b/lib/vagrant/action/builtin/ssh_run.rb @@ -1,11 +1,11 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" -require "vagrant/util/platform" -require "vagrant/util/ssh" -require "vagrant/util/shell_quote" +Vagrant.require "vagrant/util/platform" +Vagrant.require "vagrant/util/ssh" +Vagrant.require "vagrant/util/shell_quote" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/synced_folder_cleanup.rb b/lib/vagrant/action/builtin/synced_folder_cleanup.rb index 22aab95fd..b5b46f3bd 100644 --- a/lib/vagrant/action/builtin/synced_folder_cleanup.rb +++ b/lib/vagrant/action/builtin/synced_folder_cleanup.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" require_relative "mixin_synced_folders" diff --git a/lib/vagrant/action/builtin/synced_folders.rb b/lib/vagrant/action/builtin/synced_folders.rb index be11dce98..5d9c7f223 100644 --- a/lib/vagrant/action/builtin/synced_folders.rb +++ b/lib/vagrant/action/builtin/synced_folders.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" -require 'vagrant/util/platform' +Vagrant.require 'vagrant/util/platform' require_relative "mixin_synced_folders" diff --git a/lib/vagrant/action/general/package.rb b/lib/vagrant/action/general/package.rb index 0daa7f76d..0dd734289 100644 --- a/lib/vagrant/action/general/package.rb +++ b/lib/vagrant/action/general/package.rb @@ -1,12 +1,11 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'fileutils' -require "pathname" - -require 'vagrant/util/safe_chdir' -require 'vagrant/util/subprocess' -require 'vagrant/util/presence' +Vagrant.require 'fileutils' +Vagrant.require "pathname" +Vagrant.require 'vagrant/util/safe_chdir' +Vagrant.require 'vagrant/util/subprocess' +Vagrant.require 'vagrant/util/presence' module Vagrant module Action diff --git a/lib/vagrant/action/general/package_setup_folders.rb b/lib/vagrant/action/general/package_setup_folders.rb index f31b6d74a..32084b3ee 100644 --- a/lib/vagrant/action/general/package_setup_folders.rb +++ b/lib/vagrant/action/general/package_setup_folders.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" +Vagrant.require "fileutils" require_relative "package" module Vagrant diff --git a/lib/vagrant/action/runner.rb b/lib/vagrant/action/runner.rb index 67f5aa8c8..a26c531e3 100644 --- a/lib/vagrant/action/runner.rb +++ b/lib/vagrant/action/runner.rb @@ -1,11 +1,11 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'log4r' +Vagrant.require 'log4r' -require 'vagrant/action/hook' -require 'vagrant/util/busy' -require 'vagrant/util/experimental' +Vagrant.require 'vagrant/action/hook' +Vagrant.require 'vagrant/util/busy' +Vagrant.require 'vagrant/util/experimental' module Vagrant module Action diff --git a/lib/vagrant/action/warden.rb b/lib/vagrant/action/warden.rb index 33a271479..0e04b311f 100644 --- a/lib/vagrant/action/warden.rb +++ b/lib/vagrant/action/warden.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require 'vagrant/util/experimental' +Vagrant.require "log4r" +Vagrant.require 'vagrant/util/experimental' module Vagrant module Action diff --git a/lib/vagrant/alias.rb b/lib/vagrant/alias.rb index deff23699..50fa52e7e 100644 --- a/lib/vagrant/alias.rb +++ b/lib/vagrant/alias.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/registry" +Vagrant.require "vagrant/registry" module Vagrant # This class imports and processes CLI aliases stored in ~/.vagrant.d/aliases diff --git a/lib/vagrant/batch_action.rb b/lib/vagrant/batch_action.rb index dd42d3b51..21ca77189 100644 --- a/lib/vagrant/batch_action.rb +++ b/lib/vagrant/batch_action.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'thread' - -require "log4r" +Vagrant.require 'thread' +Vagrant.require "log4r" module Vagrant # This class executes multiple actions as a single batch, parallelizing diff --git a/lib/vagrant/box.rb b/lib/vagrant/box.rb index 3f636a9e4..f47a45738 100644 --- a/lib/vagrant/box.rb +++ b/lib/vagrant/box.rb @@ -1,17 +1,17 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'fileutils' -require "tempfile" +Vagrant.require 'fileutils' +Vagrant.require "tempfile" -require "json" -require "log4r" +Vagrant.require "json" +Vagrant.require "log4r" -require "vagrant/box_metadata" -require "vagrant/util/downloader" -require "vagrant/util/platform" -require "vagrant/util/safe_chdir" -require "vagrant/util/subprocess" +Vagrant.require "vagrant/box_metadata" +Vagrant.require "vagrant/util/downloader" +Vagrant.require "vagrant/util/platform" +Vagrant.require "vagrant/util/safe_chdir" +Vagrant.require "vagrant/util/subprocess" module Vagrant # Represents a "box," which is a package Vagrant environment that is used diff --git a/lib/vagrant/box_collection.rb b/lib/vagrant/box_collection.rb index 6666edae8..c9a37c4f6 100644 --- a/lib/vagrant/box_collection.rb +++ b/lib/vagrant/box_collection.rb @@ -1,15 +1,13 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "digest/sha1" -require "fileutils" -require "monitor" -require "tmpdir" - -require "log4r" - -require "vagrant/util/platform" -require "vagrant/util/subprocess" +Vagrant.require "digest/sha1" +Vagrant.require "fileutils" +Vagrant.require "monitor" +Vagrant.require "tmpdir" +Vagrant.require "log4r" +Vagrant.require "vagrant/util/platform" +Vagrant.require "vagrant/util/subprocess" module Vagrant # Represents a collection a boxes found on disk. This provides methods diff --git a/lib/vagrant/box_metadata.rb b/lib/vagrant/box_metadata.rb index b66580cb7..0a0e8f9d8 100644 --- a/lib/vagrant/box_metadata.rb +++ b/lib/vagrant/box_metadata.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "json" +Vagrant.require "json" module Vagrant # BoxMetadata represents metadata about a box, including the name diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb index 79ee6aaf8..167c0d16e 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb @@ -1,16 +1,16 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "monitor" -require "pathname" -require "set" -require "tempfile" -require "fileutils" -require "uri" +Vagrant.require "monitor" +Vagrant.require "pathname" +Vagrant.require "set" +Vagrant.require "tempfile" +Vagrant.require "fileutils" +Vagrant.require "uri" -require "rubygems/package" -require "rubygems/uninstaller" -require "rubygems/name_tuple" +Vagrant.require "rubygems/package" +Vagrant.require "rubygems/uninstaller" +Vagrant.require "rubygems/name_tuple" require_relative "shared_helpers" require_relative "version" diff --git a/lib/vagrant/cli.rb b/lib/vagrant/cli.rb index 17eb86e27..da6b29144 100644 --- a/lib/vagrant/cli.rb +++ b/lib/vagrant/cli.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'log4r' -require 'optparse' +Vagrant.require 'log4r' +Vagrant.require 'optparse' -require 'vagrant/util/experimental' +Vagrant.require 'vagrant/util/experimental' module Vagrant # Manages the command line interface to Vagrant. diff --git a/lib/vagrant/config.rb b/lib/vagrant/config.rb index 789ce37a8..3ccce5c6f 100644 --- a/lib/vagrant/config.rb +++ b/lib/vagrant/config.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/registry" +Vagrant.require "vagrant/registry" module Vagrant module Config diff --git a/lib/vagrant/config/v1/loader.rb b/lib/vagrant/config/v1/loader.rb index b567b92cd..a86a53032 100644 --- a/lib/vagrant/config/v1/loader.rb +++ b/lib/vagrant/config/v1/loader.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/config/v1/root" +Vagrant.require "vagrant/config/v1/root" module Vagrant module Config diff --git a/lib/vagrant/config/v1/root.rb b/lib/vagrant/config/v1/root.rb index f8005f6e6..1fbc3d225 100644 --- a/lib/vagrant/config/v1/root.rb +++ b/lib/vagrant/config/v1/root.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "set" +Vagrant.require "set" module Vagrant module Config diff --git a/lib/vagrant/config/v2/loader.rb b/lib/vagrant/config/v2/loader.rb index beed66105..f905ef8a6 100644 --- a/lib/vagrant/config/v2/loader.rb +++ b/lib/vagrant/config/v2/loader.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/config/v2/root" +Vagrant.require "vagrant/config/v2/root" module Vagrant module Config diff --git a/lib/vagrant/config/v2/root.rb b/lib/vagrant/config/v2/root.rb index cf2e5856b..4f68d4292 100644 --- a/lib/vagrant/config/v2/root.rb +++ b/lib/vagrant/config/v2/root.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "set" +Vagrant.require "set" -require "vagrant/config/v2/util" +Vagrant.require "vagrant/config/v2/util" module Vagrant module Config diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 24f6e191a..a916837c9 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -1,20 +1,20 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'fileutils' -require 'json' -require 'pathname' -require 'set' -require 'thread' +Vagrant.require 'fileutils' +Vagrant.require 'json' +Vagrant.require 'pathname' +Vagrant.require 'set' +Vagrant.require 'thread' -require 'log4r' +Vagrant.require 'log4r' -require 'vagrant/util/file_mode' -require 'vagrant/util/platform' -require 'vagrant/util/hash_with_indifferent_access' -require "vagrant/util/silence_warnings" -require "vagrant/vagrantfile" -require "vagrant/version" +Vagrant.require 'vagrant/util/file_mode' +Vagrant.require 'vagrant/util/platform' +Vagrant.require 'vagrant/util/hash_with_indifferent_access' +Vagrant.require "vagrant/util/silence_warnings" +Vagrant.require "vagrant/vagrantfile" +Vagrant.require "vagrant/version" module Vagrant # A "Vagrant environment" represents a configuration of how Vagrant diff --git a/lib/vagrant/environment/remote.rb b/lib/vagrant/environment/remote.rb index aeaafc7a3..eba3bdaae 100644 --- a/lib/vagrant/environment/remote.rb +++ b/lib/vagrant/environment/remote.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'vagrant/machine_index/remote' +Vagrant.require 'vagrant/machine_index/remote' module Vagrant class Environment diff --git a/lib/vagrant/guest.rb b/lib/vagrant/guest.rb index 6e86f7af9..920110b6c 100644 --- a/lib/vagrant/guest.rb +++ b/lib/vagrant/guest.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" - -require "vagrant/capability_host" +Vagrant.require "log4r" +Vagrant.require "vagrant/capability_host" module Vagrant # This class handles guest-OS specific interactions with a machine. diff --git a/lib/vagrant/host.rb b/lib/vagrant/host.rb index 349442356..04c43afc8 100644 --- a/lib/vagrant/host.rb +++ b/lib/vagrant/host.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/capability_host" +Vagrant.require "vagrant/capability_host" module Vagrant # This class handles host-OS specific interactions. It is responsible for diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 7da6bb365..766762e41 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -4,10 +4,9 @@ require_relative "./util/ssh" require_relative "./action/builtin/mixin_synced_folders" -require "digest/md5" -require "thread" - -require "log4r" +Vagrant.require "digest/md5" +Vagrant.require "thread" +Vagrant.require "log4r" module Vagrant # This represents a machine that Vagrant manages. This provides a singular diff --git a/lib/vagrant/machine/remote.rb b/lib/vagrant/machine/remote.rb index 8d3972a6d..5c5144f98 100644 --- a/lib/vagrant/machine/remote.rb +++ b/lib/vagrant/machine/remote.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'ostruct' -require "vagrant/util/scoped_hash_override" +Vagrant.require 'ostruct' +Vagrant.require "vagrant/util/scoped_hash_override" module Vagrant class Machine diff --git a/lib/vagrant/machine_index.rb b/lib/vagrant/machine_index.rb index 188667aaa..24d75a85f 100644 --- a/lib/vagrant/machine_index.rb +++ b/lib/vagrant/machine_index.rb @@ -1,12 +1,12 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "json" -require "pathname" -require "securerandom" -require "thread" +Vagrant.require "json" +Vagrant.require "pathname" +Vagrant.require "securerandom" +Vagrant.require "thread" -require "vagrant/util/silence_warnings" +Vagrant.require "vagrant/util/silence_warnings" module Vagrant # MachineIndex is able to manage the index of created Vagrant environments diff --git a/lib/vagrant/patches/fake_ftp.rb b/lib/vagrant/patches/fake_ftp.rb index 8831e3a8d..73bd693aa 100644 --- a/lib/vagrant/patches/fake_ftp.rb +++ b/lib/vagrant/patches/fake_ftp.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fake_ftp" +Vagrant.require "fake_ftp" module FakeFtp class File diff --git a/lib/vagrant/patches/log4r.rb b/lib/vagrant/patches/log4r.rb index 99bde895d..323249543 100644 --- a/lib/vagrant/patches/log4r.rb +++ b/lib/vagrant/patches/log4r.rb @@ -6,7 +6,7 @@ # information should be included in the output, we # make some modifications to allow the trace check to # still work while also supporting trace as a valid level -require "log4r/loggerfactory" +Vagrant.require "log4r/loggerfactory" if !Log4r::Logger::LoggerFactory.respond_to?(:fake_define_methods) class Log4r::Logger::LoggerFactory diff --git a/lib/vagrant/patches/net-ssh.rb b/lib/vagrant/patches/net-ssh.rb index 4f505a2ce..e6b3db4ce 100644 --- a/lib/vagrant/patches/net-ssh.rb +++ b/lib/vagrant/patches/net-ssh.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "net/ssh" -require "net/ssh/buffer" +Vagrant.require "net/ssh" +Vagrant.require "net/ssh/buffer" # Set the version requirement for when net-ssh should be patched NET_SSH_PATCH_REQUIREMENT = Gem::Requirement.new(">= 7.0.0", "<= 7.3") diff --git a/lib/vagrant/plugin/manager.rb b/lib/vagrant/plugin/manager.rb index 8d568141a..d4a003f36 100644 --- a/lib/vagrant/plugin/manager.rb +++ b/lib/vagrant/plugin/manager.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "set" +Vagrant.require "pathname" +Vagrant.require "set" require_relative "../bundler" require_relative "../shared_helpers" diff --git a/lib/vagrant/plugin/remote.rb b/lib/vagrant/plugin/remote.rb index 3d684f55b..1f92de9b5 100644 --- a/lib/vagrant/plugin/remote.rb +++ b/lib/vagrant/plugin/remote.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/remote/manager.rb b/lib/vagrant/plugin/remote/manager.rb index 1c199d9f8..a6bd4aded 100644 --- a/lib/vagrant/plugin/remote/manager.rb +++ b/lib/vagrant/plugin/remote/manager.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/state_file.rb b/lib/vagrant/plugin/state_file.rb index c514ca67c..378ee7f23 100644 --- a/lib/vagrant/plugin/state_file.rb +++ b/lib/vagrant/plugin/state_file.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "json" -require "fileutils" -require "tempfile" +Vagrant.require "json" +Vagrant.require "fileutils" +Vagrant.require "tempfile" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v1.rb b/lib/vagrant/plugin/v1.rb index 5aa9be4f9..b0527af28 100644 --- a/lib/vagrant/plugin/v1.rb +++ b/lib/vagrant/plugin/v1.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" - -require "vagrant/plugin/v1/errors" +Vagrant.require "log4r" +Vagrant.require "vagrant/plugin/v1/errors" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v1/command.rb b/lib/vagrant/plugin/v1/command.rb index b1bb63680..b240d8ce6 100644 --- a/lib/vagrant/plugin/v1/command.rb +++ b/lib/vagrant/plugin/v1/command.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'log4r' - -require "vagrant/util/safe_puts" +Vagrant.require 'log4r' +Vagrant.require "vagrant/util/safe_puts" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v1/manager.rb b/lib/vagrant/plugin/v1/manager.rb index d4180ea8e..8d1aeaba3 100644 --- a/lib/vagrant/plugin/v1/manager.rb +++ b/lib/vagrant/plugin/v1/manager.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v1/plugin.rb b/lib/vagrant/plugin/v1/plugin.rb index 2bab79c36..69e953044 100644 --- a/lib/vagrant/plugin/v1/plugin.rb +++ b/lib/vagrant/plugin/v1/plugin.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "set" - -require "log4r" +Vagrant.require "set" +Vagrant.require "log4r" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2.rb b/lib/vagrant/plugin/v2.rb index b9264ed69..1da18fc7c 100644 --- a/lib/vagrant/plugin/v2.rb +++ b/lib/vagrant/plugin/v2.rb @@ -1,12 +1,12 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" # We don't autoload components because if we're loading anything in the # V2 namespace anyways, then we're going to need the Components class. -require "vagrant/plugin/v2/components" -require "vagrant/plugin/v2/errors" +Vagrant.require "vagrant/plugin/v2/components" +Vagrant.require "vagrant/plugin/v2/errors" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2/command.rb b/lib/vagrant/plugin/v2/command.rb index ffb61f7a5..d29d4f2a0 100644 --- a/lib/vagrant/plugin/v2/command.rb +++ b/lib/vagrant/plugin/v2/command.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'log4r' - -require "vagrant/util/safe_puts" +Vagrant.require 'log4r' +Vagrant.require "vagrant/util/safe_puts" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2/communicator.rb b/lib/vagrant/plugin/v2/communicator.rb index 35acb8a0a..58804fb0d 100644 --- a/lib/vagrant/plugin/v2/communicator.rb +++ b/lib/vagrant/plugin/v2/communicator.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "timeout" +Vagrant.require "timeout" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2/config.rb b/lib/vagrant/plugin/v2/config.rb index 06352de2a..b0ed312ab 100644 --- a/lib/vagrant/plugin/v2/config.rb +++ b/lib/vagrant/plugin/v2/config.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "set" +Vagrant.require "set" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2/manager.rb b/lib/vagrant/plugin/v2/manager.rb index 32218d4f8..9b01f3a56 100644 --- a/lib/vagrant/plugin/v2/manager.rb +++ b/lib/vagrant/plugin/v2/manager.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2/plugin.rb b/lib/vagrant/plugin/v2/plugin.rb index b83a095e7..2d57a806a 100644 --- a/lib/vagrant/plugin/v2/plugin.rb +++ b/lib/vagrant/plugin/v2/plugin.rb @@ -1,11 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "set" - -require "log4r" - -require "vagrant/plugin/v2/components" +Vagrant.require "set" +Vagrant.require "log4r" +Vagrant.require "vagrant/plugin/v2/components" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2/provider.rb b/lib/vagrant/plugin/v2/provider.rb index 2d1c68a75..f13a050a9 100644 --- a/lib/vagrant/plugin/v2/provider.rb +++ b/lib/vagrant/plugin/v2/provider.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/capability_host" +Vagrant.require "vagrant/capability_host" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2/trigger.rb b/lib/vagrant/plugin/v2/trigger.rb index 3f9abb55b..7e64bcaeb 100644 --- a/lib/vagrant/plugin/v2/trigger.rb +++ b/lib/vagrant/plugin/v2/trigger.rb @@ -1,14 +1,14 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'fileutils' -require 'log4r' -require 'shellwords' +Vagrant.require 'fileutils' +Vagrant.require 'log4r' +Vagrant.require 'shellwords' -require Vagrant.source_root.join("plugins/provisioners/shell/provisioner") -require "vagrant/util/subprocess" -require "vagrant/util/platform" -require "vagrant/util/powershell" +Vagrant.require Vagrant.source_root.join("plugins/provisioners/shell/provisioner") +Vagrant.require "vagrant/util/subprocess" +Vagrant.require "vagrant/util/platform" +Vagrant.require "vagrant/util/powershell" module Vagrant module Plugin diff --git a/lib/vagrant/shared_helpers.rb b/lib/vagrant/shared_helpers.rb index 45ebff2e0..be0baa313 100644 --- a/lib/vagrant/shared_helpers.rb +++ b/lib/vagrant/shared_helpers.rb @@ -168,7 +168,7 @@ module Vagrant if ENV["VAGRANT_ENABLE_RESOLV_REPLACE"] if !ENV["VAGRANT_DISABLE_RESOLV_REPLACE"] begin - require "resolv-replace" + Vagrant.require "resolv-replace" true rescue false @@ -192,7 +192,7 @@ module Vagrant # @return [Logger] def self.global_logger if @_global_logger.nil? - require "log4r" + Vagrant.require "log4r" @_global_logger = Log4r::Logger.new("vagrant::global") end @_global_logger @@ -226,6 +226,68 @@ module Vagrant @_default_cli_options.dup end + # Loads the provided path. If the base of the path + # is a Vagrant runtime dependency, the gem will be + # activated with the proper constraint first. + # + # NOTE: This is currently disabled by default and + # will transition to enabled by default as more + # non-installer based environments are tested. + # + # @return [nil] + def self.require(path) + catch(:activation_complete) do + # If activation is not enabled, don't attempt activation + throw :activation_complete if ENV["VAGRANT_ENABLE_GEM_ACTIVATION"].nil? + + # If it's a vagrant path, don't do anything. + throw :activation_complete if path.to_s.start_with?("vagrant/") + + # Attempt to fetch the vagrant specification + if @_vagrant_spec.nil? + @_vagrant_activated_dependencies = {} + begin + @_vagrant_spec = Gem::Specification.find_by_name("vagrant") + rescue Gem::MissingSpecError + # If it couldn't be found, print a warning to stderr and bail + if !@_spec_load_failure_warning + $stderr.puts "WARN: Failed to locate vagrant specification for dependency loading" + @_spec_load_failure_warning = true + end + + throw :activation_complete + end + end + + # Attempt to get the name of the gem by the given path + dep_name = Gem::Specification.find_by_path(path)&.name + + # Bail if a dependency name cannot be determined + throw :activation_complete if dep_name.nil? + + # Bail if already activated + throw :activation_complete if @_vagrant_activated_dependencies[dep_name] + + # Extract the dependency from the runtime dependency list + dependency = @_vagrant_spec.runtime_dependencies.detect do |d| + d.name == dep_name + end + + # If the dependency isn't found, bail + throw :activation_complete if dependency.nil? + + # Activate the gem + gem(dependency.name, dependency.requirement.as_list) +puts "Activated: #{dependency.name}" + @_vagrant_activated_dependencies[dependency.name] = true + end + + # Finally, require the provided path. + ::Kernel.require(path) + + nil + end + # Check if Vagrant is running in server mode # # @return [Boolean] diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index de4daff67..7f6a675f9 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -1,14 +1,12 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "delegate" -require "io/console" -require "thread" - -require "log4r" - -require "vagrant/util/platform" -require "vagrant/util/safe_puts" +Vagrant.require "delegate" +Vagrant.require "io/console" +Vagrant.require "thread" +Vagrant.require "log4r" +Vagrant.require "vagrant/util/platform" +Vagrant.require "vagrant/util/safe_puts" module Vagrant module UI diff --git a/lib/vagrant/util/caps.rb b/lib/vagrant/util/caps.rb index 234335e11..b9c340eb5 100644 --- a/lib/vagrant/util/caps.rb +++ b/lib/vagrant/util/caps.rb @@ -1,11 +1,11 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" -require "fileutils" -require "pathname" -require "vagrant/util/directory" -require "vagrant/util/subprocess" +Vagrant.require "tempfile" +Vagrant.require "fileutils" +Vagrant.require "pathname" +Vagrant.require "vagrant/util/directory" +Vagrant.require "vagrant/util/subprocess" module Vagrant module Util diff --git a/lib/vagrant/util/checkpoint_client.rb b/lib/vagrant/util/checkpoint_client.rb index 8480786ca..bdf8f8ff2 100644 --- a/lib/vagrant/util/checkpoint_client.rb +++ b/lib/vagrant/util/checkpoint_client.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "singleton" +Vagrant.require "log4r" +Vagrant.require "singleton" module Vagrant module Util diff --git a/lib/vagrant/util/counter.rb b/lib/vagrant/util/counter.rb index f25a2cb11..7e2c38d5e 100644 --- a/lib/vagrant/util/counter.rb +++ b/lib/vagrant/util/counter.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'thread' +Vagrant.require 'thread' module Vagrant module Util diff --git a/lib/vagrant/util/directory.rb b/lib/vagrant/util/directory.rb index 55e502eab..2b561ab86 100644 --- a/lib/vagrant/util/directory.rb +++ b/lib/vagrant/util/directory.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'pathname' +Vagrant.require 'pathname' module Vagrant module Util diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb index 6b197b71f..4d96e460d 100644 --- a/lib/vagrant/util/downloader.rb +++ b/lib/vagrant/util/downloader.rb @@ -1,18 +1,18 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "cgi" -require "uri" +Vagrant.require "cgi" +Vagrant.require "uri" -require "log4r" -require "digest" -require "digest/md5" -require "digest/sha1" -require "vagrant/util/busy" -require "vagrant/util/platform" -require "vagrant/util/subprocess" -require "vagrant/util/curl_helper" -require "vagrant/util/file_checksum" +Vagrant.require "log4r" +Vagrant.require "digest" +Vagrant.require "digest/md5" +Vagrant.require "digest/sha1" +Vagrant.require "vagrant/util/busy" +Vagrant.require "vagrant/util/platform" +Vagrant.require "vagrant/util/subprocess" +Vagrant.require "vagrant/util/curl_helper" +Vagrant.require "vagrant/util/file_checksum" module Vagrant module Util diff --git a/lib/vagrant/util/file_checksum.rb b/lib/vagrant/util/file_checksum.rb index 83409eb50..c6d4f8ae7 100644 --- a/lib/vagrant/util/file_checksum.rb +++ b/lib/vagrant/util/file_checksum.rb @@ -6,7 +6,7 @@ # the moment, and this class isn't directly used. It is merely here for # documentation of structure of the class. -require "vagrant/errors" +Vagrant.require "vagrant/errors" class DigestClass def update(string); end diff --git a/lib/vagrant/util/io.rb b/lib/vagrant/util/io.rb index a6eada0e3..0202c6227 100644 --- a/lib/vagrant/util/io.rb +++ b/lib/vagrant/util/io.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/util/platform" +Vagrant.require "vagrant/util/platform" module Vagrant module Util diff --git a/lib/vagrant/util/is_port_open.rb b/lib/vagrant/util/is_port_open.rb index 8354dda4b..ec7c96b5f 100644 --- a/lib/vagrant/util/is_port_open.rb +++ b/lib/vagrant/util/is_port_open.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "socket" +Vagrant.require "socket" module Vagrant module Util diff --git a/lib/vagrant/util/keypair.rb b/lib/vagrant/util/keypair.rb index c3ce48603..0e5933060 100644 --- a/lib/vagrant/util/keypair.rb +++ b/lib/vagrant/util/keypair.rb @@ -1,11 +1,11 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "base64" -require "ed25519" -require "securerandom" +Vagrant.require "base64" +Vagrant.require "ed25519" +Vagrant.require "securerandom" -require "vagrant/util/retryable" +Vagrant.require "vagrant/util/retryable" module Vagrant module Util diff --git a/lib/vagrant/util/logging_formatter.rb b/lib/vagrant/util/logging_formatter.rb index 41fc359fd..b7944a484 100644 --- a/lib/vagrant/util/logging_formatter.rb +++ b/lib/vagrant/util/logging_formatter.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/util/credential_scrubber" -require "log4r/formatter/formatter" +Vagrant.require "vagrant/util/credential_scrubber" +Vagrant.require "log4r/formatter/formatter" module Vagrant module Util diff --git a/lib/vagrant/util/mime.rb b/lib/vagrant/util/mime.rb index 8b1036c6d..24de8dd88 100644 --- a/lib/vagrant/util/mime.rb +++ b/lib/vagrant/util/mime.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'mime/types' -require 'securerandom' +Vagrant.require 'mime/types' +Vagrant.require 'securerandom' module Vagrant module Util diff --git a/lib/vagrant/util/network_ip.rb b/lib/vagrant/util/network_ip.rb index a02752d9d..0d2ec0aaa 100644 --- a/lib/vagrant/util/network_ip.rb +++ b/lib/vagrant/util/network_ip.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "ipaddr" +Vagrant.require "ipaddr" module Vagrant module Util diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb index b99314c30..2070091ef 100644 --- a/lib/vagrant/util/platform.rb +++ b/lib/vagrant/util/platform.rb @@ -1,15 +1,15 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "rbconfig" -require "shellwords" -require "tempfile" -require "tmpdir" -require "log4r" +Vagrant.require "rbconfig" +Vagrant.require "shellwords" +Vagrant.require "tempfile" +Vagrant.require "tmpdir" +Vagrant.require "log4r" -require "vagrant/util/subprocess" -require "vagrant/util/powershell" -require "vagrant/util/which" +Vagrant.require "vagrant/util/subprocess" +Vagrant.require "vagrant/util/powershell" +Vagrant.require "vagrant/util/which" module Vagrant module Util diff --git a/lib/vagrant/util/powershell.rb b/lib/vagrant/util/powershell.rb index e2d2bad84..134637ea8 100644 --- a/lib/vagrant/util/powershell.rb +++ b/lib/vagrant/util/powershell.rb @@ -1,8 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "base64" -require "tmpdir" +Vagrant.require "base64" +Vagrant.require "tmpdir" + require_relative "subprocess" require_relative "which" diff --git a/lib/vagrant/util/retryable.rb b/lib/vagrant/util/retryable.rb index 2e3ef18bf..60cc8617b 100644 --- a/lib/vagrant/util/retryable.rb +++ b/lib/vagrant/util/retryable.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module Vagrant module Util diff --git a/lib/vagrant/util/safe_chdir.rb b/lib/vagrant/util/safe_chdir.rb index 3dacda2e4..7314ee7bd 100644 --- a/lib/vagrant/util/safe_chdir.rb +++ b/lib/vagrant/util/safe_chdir.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'thread' +Vagrant.require 'thread' module Vagrant module Util diff --git a/lib/vagrant/util/ssh.rb b/lib/vagrant/util/ssh.rb index 89ec5f5b6..8f3b74e7e 100644 --- a/lib/vagrant/util/ssh.rb +++ b/lib/vagrant/util/ssh.rb @@ -1,16 +1,16 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" -require 'childprocess' +Vagrant.require 'childprocess' -require "vagrant/util/file_mode" -require "vagrant/util/platform" -require "vagrant/util/safe_exec" -require "vagrant/util/safe_puts" -require "vagrant/util/subprocess" -require "vagrant/util/which" +Vagrant.require "vagrant/util/file_mode" +Vagrant.require "vagrant/util/platform" +Vagrant.require "vagrant/util/safe_exec" +Vagrant.require "vagrant/util/safe_puts" +Vagrant.require "vagrant/util/subprocess" +Vagrant.require "vagrant/util/which" module Vagrant module Util diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb index a07e26e66..19c56248f 100644 --- a/lib/vagrant/util/subprocess.rb +++ b/lib/vagrant/util/subprocess.rb @@ -1,15 +1,15 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'thread' +Vagrant.require 'thread' -require 'childprocess' -require 'log4r' +Vagrant.require 'childprocess' +Vagrant.require 'log4r' -require 'vagrant/util/io' -require 'vagrant/util/platform' -require 'vagrant/util/safe_chdir' -require 'vagrant/util/which' +Vagrant.require 'vagrant/util/io' +Vagrant.require 'vagrant/util/platform' +Vagrant.require 'vagrant/util/safe_chdir' +Vagrant.require 'vagrant/util/which' module Vagrant module Util diff --git a/lib/vagrant/util/template_renderer.rb b/lib/vagrant/util/template_renderer.rb index 272e9eff6..17d7a3aba 100644 --- a/lib/vagrant/util/template_renderer.rb +++ b/lib/vagrant/util/template_renderer.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'ostruct' -require "pathname" +Vagrant.require 'ostruct' +Vagrant.require "pathname" -require 'erubi' +Vagrant.require 'erubi' module Vagrant module Util diff --git a/lib/vagrant/util/uploader.rb b/lib/vagrant/util/uploader.rb index 8e6632546..804f391b8 100644 --- a/lib/vagrant/util/uploader.rb +++ b/lib/vagrant/util/uploader.rb @@ -1,13 +1,13 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "uri" +Vagrant.require "uri" -require "log4r" -require "vagrant/util/busy" -require "vagrant/util/platform" -require "vagrant/util/subprocess" -require "vagrant/util/curl_helper" +Vagrant.require "log4r" +Vagrant.require "vagrant/util/busy" +Vagrant.require "vagrant/util/platform" +Vagrant.require "vagrant/util/subprocess" +Vagrant.require "vagrant/util/curl_helper" module Vagrant module Util diff --git a/lib/vagrant/util/which.rb b/lib/vagrant/util/which.rb index e84a91abb..cce735f56 100644 --- a/lib/vagrant/util/which.rb +++ b/lib/vagrant/util/which.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/util/platform" +Vagrant.require "vagrant/util/platform" module Vagrant module Util diff --git a/lib/vagrant/util/windows_path.rb b/lib/vagrant/util/windows_path.rb index bbafbdc59..13df069c4 100644 --- a/lib/vagrant/util/windows_path.rb +++ b/lib/vagrant/util/windows_path.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fiddle/import" +Vagrant.require "fiddle/import" module Vagrant module Util diff --git a/lib/vagrant/vagrantfile.rb b/lib/vagrant/vagrantfile.rb index d663653c6..0ee3b46ec 100644 --- a/lib/vagrant/vagrantfile.rb +++ b/lib/vagrant/vagrantfile.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/util/template_renderer" -require "log4r" +Vagrant.require "vagrant/util/template_renderer" +Vagrant.require "log4r" module Vagrant # This class provides a way to load and access the contents diff --git a/plugins/commands/autocomplete/command/install.rb b/plugins/commands/autocomplete/command/install.rb index df76686fe..b3caf0a5d 100644 --- a/plugins/commands/autocomplete/command/install.rb +++ b/plugins/commands/autocomplete/command/install.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require 'vagrant/util/install_cli_autocomplete' diff --git a/plugins/commands/autocomplete/command/root.rb b/plugins/commands/autocomplete/command/root.rb index 0b9e4a87e..7bc63e37b 100644 --- a/plugins/commands/autocomplete/command/root.rb +++ b/plugins/commands/autocomplete/command/root.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "optparse" +Vagrant.require "optparse" require 'vagrant/util/install_cli_autocomplete' module VagrantPlugins diff --git a/plugins/commands/box/command/add.rb b/plugins/commands/box/command/add.rb index 9d33b27c6..c54118477 100644 --- a/plugins/commands/box/command/add.rb +++ b/plugins/commands/box/command/add.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require_relative 'download_mixins' diff --git a/plugins/commands/box/command/list.rb b/plugins/commands/box/command/list.rb index d55c138b6..47e41b362 100644 --- a/plugins/commands/box/command/list.rb +++ b/plugins/commands/box/command/list.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandBox diff --git a/plugins/commands/box/command/outdated.rb b/plugins/commands/box/command/outdated.rb index 7bfa07690..e7dab0ad4 100644 --- a/plugins/commands/box/command/outdated.rb +++ b/plugins/commands/box/command/outdated.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require_relative 'download_mixins' diff --git a/plugins/commands/box/command/prune.rb b/plugins/commands/box/command/prune.rb index bee29993e..a456e6305 100644 --- a/plugins/commands/box/command/prune.rb +++ b/plugins/commands/box/command/prune.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandBox diff --git a/plugins/commands/box/command/remove.rb b/plugins/commands/box/command/remove.rb index 9a8b88aed..45f9f0591 100644 --- a/plugins/commands/box/command/remove.rb +++ b/plugins/commands/box/command/remove.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandBox diff --git a/plugins/commands/box/command/repackage.rb b/plugins/commands/box/command/repackage.rb index d7de9a478..193b8189a 100644 --- a/plugins/commands/box/command/repackage.rb +++ b/plugins/commands/box/command/repackage.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" -require 'optparse' -require "pathname" +Vagrant.require "fileutils" +Vagrant.require 'optparse' +Vagrant.require "pathname" module VagrantPlugins module CommandBox diff --git a/plugins/commands/box/command/root.rb b/plugins/commands/box/command/root.rb index 7a62ede17..f0a0db3d2 100644 --- a/plugins/commands/box/command/root.rb +++ b/plugins/commands/box/command/root.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandBox diff --git a/plugins/commands/box/command/update.rb b/plugins/commands/box/command/update.rb index 34312cc51..1e9c10641 100644 --- a/plugins/commands/box/command/update.rb +++ b/plugins/commands/box/command/update.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require_relative 'download_mixins' diff --git a/plugins/commands/cap/command.rb b/plugins/commands/cap/command.rb index dac52b749..93c0ee12c 100644 --- a/plugins/commands/cap/command.rb +++ b/plugins/commands/cap/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandCap diff --git a/plugins/commands/cloud/auth/login.rb b/plugins/commands/cloud/auth/login.rb index 14dbfa7d9..59282a5c0 100644 --- a/plugins/commands/cloud/auth/login.rb +++ b/plugins/commands/cloud/auth/login.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/auth/logout.rb b/plugins/commands/cloud/auth/logout.rb index c80414868..2158ea54f 100644 --- a/plugins/commands/cloud/auth/logout.rb +++ b/plugins/commands/cloud/auth/logout.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/auth/middleware/add_authentication.rb b/plugins/commands/cloud/auth/middleware/add_authentication.rb index 423c49abd..2a9ec134f 100644 --- a/plugins/commands/cloud/auth/middleware/add_authentication.rb +++ b/plugins/commands/cloud/auth/middleware/add_authentication.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "cgi" -require "uri" -require "log4r" +Vagrant.require "cgi" +Vagrant.require "uri" +Vagrant.require "log4r" require Vagrant.source_root.join("plugins/commands/cloud/client/client") diff --git a/plugins/commands/cloud/auth/middleware/add_downloader_authentication.rb b/plugins/commands/cloud/auth/middleware/add_downloader_authentication.rb index ee4903193..cdd9c8e33 100644 --- a/plugins/commands/cloud/auth/middleware/add_downloader_authentication.rb +++ b/plugins/commands/cloud/auth/middleware/add_downloader_authentication.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "cgi" -require "uri" +Vagrant.require "cgi" +Vagrant.require "uri" +Vagrant.require "vagrant/util/credential_scrubber" -require "vagrant/util/credential_scrubber" require_relative "./add_authentication" require Vagrant.source_root.join("plugins/commands/cloud/client/client") diff --git a/plugins/commands/cloud/auth/whoami.rb b/plugins/commands/cloud/auth/whoami.rb index b7e2f9111..f5686658c 100644 --- a/plugins/commands/cloud/auth/whoami.rb +++ b/plugins/commands/cloud/auth/whoami.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/box/create.rb b/plugins/commands/cloud/box/create.rb index 7f92a57d0..f1ec6379e 100644 --- a/plugins/commands/cloud/box/create.rb +++ b/plugins/commands/cloud/box/create.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/box/delete.rb b/plugins/commands/cloud/box/delete.rb index 85e04594d..8c9621a25 100644 --- a/plugins/commands/cloud/box/delete.rb +++ b/plugins/commands/cloud/box/delete.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/box/show.rb b/plugins/commands/cloud/box/show.rb index 101387ab6..da483e456 100644 --- a/plugins/commands/cloud/box/show.rb +++ b/plugins/commands/cloud/box/show.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/box/update.rb b/plugins/commands/cloud/box/update.rb index 84432ef4d..952cc43cb 100644 --- a/plugins/commands/cloud/box/update.rb +++ b/plugins/commands/cloud/box/update.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/client/client.rb b/plugins/commands/cloud/client/client.rb index 1e7fec351..945700c3a 100644 --- a/plugins/commands/cloud/client/client.rb +++ b/plugins/commands/cloud/client/client.rb @@ -1,9 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant_cloud" -require "vagrant/util/downloader" -require "vagrant/util/presence" +Vagrant.require "vagrant_cloud" +Vagrant.require "vagrant/util/downloader" +Vagrant.require "vagrant/util/presence" + require Vagrant.source_root.join("plugins/commands/cloud/errors") module VagrantPlugins diff --git a/plugins/commands/cloud/list.rb b/plugins/commands/cloud/list.rb index 2ec2b37fc..a9dd7e44a 100644 --- a/plugins/commands/cloud/list.rb +++ b/plugins/commands/cloud/list.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/plugin.rb b/plugins/commands/cloud/plugin.rb index b09a0388a..d0d243582 100644 --- a/plugins/commands/cloud/plugin.rb +++ b/plugins/commands/cloud/plugin.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant" -require 'vagrant_cloud' +Vagrant.require 'vagrant_cloud' + require Vagrant.source_root.join("plugins/commands/cloud/util") require Vagrant.source_root.join("plugins/commands/cloud/client/client") diff --git a/plugins/commands/cloud/provider/create.rb b/plugins/commands/cloud/provider/create.rb index 30c55c7d6..860695367 100644 --- a/plugins/commands/cloud/provider/create.rb +++ b/plugins/commands/cloud/provider/create.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/provider/delete.rb b/plugins/commands/cloud/provider/delete.rb index f80ebff32..fc09a739e 100644 --- a/plugins/commands/cloud/provider/delete.rb +++ b/plugins/commands/cloud/provider/delete.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/provider/update.rb b/plugins/commands/cloud/provider/update.rb index 22bb6b75b..81d39e784 100644 --- a/plugins/commands/cloud/provider/update.rb +++ b/plugins/commands/cloud/provider/update.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/provider/upload.rb b/plugins/commands/cloud/provider/upload.rb index 47c9f3bbe..bf936a5e3 100644 --- a/plugins/commands/cloud/provider/upload.rb +++ b/plugins/commands/cloud/provider/upload.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' -require "vagrant/util/uploader" +Vagrant.require 'optparse' +Vagrant.require "vagrant/util/uploader" module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/publish.rb b/plugins/commands/cloud/publish.rb index a8e9c71b6..d56570a8b 100644 --- a/plugins/commands/cloud/publish.rb +++ b/plugins/commands/cloud/publish.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' -require "vagrant/util/uploader" +Vagrant.require 'optparse' +Vagrant.require "vagrant/util/uploader" module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/search.rb b/plugins/commands/cloud/search.rb index a18793b2b..8cba5f720 100644 --- a/plugins/commands/cloud/search.rb +++ b/plugins/commands/cloud/search.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/version/release.rb b/plugins/commands/cloud/version/release.rb index c04a14f5f..9a204f85b 100644 --- a/plugins/commands/cloud/version/release.rb +++ b/plugins/commands/cloud/version/release.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/version/revoke.rb b/plugins/commands/cloud/version/revoke.rb index dfdaaa21e..96bb6b548 100644 --- a/plugins/commands/cloud/version/revoke.rb +++ b/plugins/commands/cloud/version/revoke.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/version/update.rb b/plugins/commands/cloud/version/update.rb index 380ba7498..6e2a8ce37 100644 --- a/plugins/commands/cloud/version/update.rb +++ b/plugins/commands/cloud/version/update.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/global-status/command.rb b/plugins/commands/global-status/command.rb index bd0e15152..d8fdc5c6f 100644 --- a/plugins/commands/global-status/command.rb +++ b/plugins/commands/global-status/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandGlobalStatus diff --git a/plugins/commands/halt/command.rb b/plugins/commands/halt/command.rb index 9094602de..5117c7ee3 100644 --- a/plugins/commands/halt/command.rb +++ b/plugins/commands/halt/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandHalt diff --git a/plugins/commands/help/command.rb b/plugins/commands/help/command.rb index 23414e2c0..aba3a9677 100644 --- a/plugins/commands/help/command.rb +++ b/plugins/commands/help/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandHelp diff --git a/plugins/commands/init/command.rb b/plugins/commands/init/command.rb index 45dacdcfe..2e50cbb57 100644 --- a/plugins/commands/init/command.rb +++ b/plugins/commands/init/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require 'vagrant/util/template_renderer' diff --git a/plugins/commands/list-commands/command.rb b/plugins/commands/list-commands/command.rb index d2b9e10d9..3e2202648 100644 --- a/plugins/commands/list-commands/command.rb +++ b/plugins/commands/list-commands/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "optparse" +Vagrant.require "optparse" module VagrantPlugins module CommandListCommands diff --git a/plugins/commands/package/command.rb b/plugins/commands/package/command.rb index fd0c92ed6..3ce62da18 100644 --- a/plugins/commands/package/command.rb +++ b/plugins/commands/package/command.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' -require 'securerandom' +Vagrant.require 'optparse' +Vagrant.require 'securerandom' module VagrantPlugins module CommandPackage diff --git a/plugins/commands/plugin/action.rb b/plugins/commands/plugin/action.rb index 9a9b964a0..10daeb32c 100644 --- a/plugins/commands/plugin/action.rb +++ b/plugins/commands/plugin/action.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" +Vagrant.require "pathname" -require "vagrant/action/builder" +Vagrant.require "vagrant/action/builder" module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/plugin/action/expunge_plugins.rb b/plugins/commands/plugin/action/expunge_plugins.rb index 956885f25..6018809bd 100644 --- a/plugins/commands/plugin/action/expunge_plugins.rb +++ b/plugins/commands/plugin/action/expunge_plugins.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/plugin/manager" +Vagrant.require "vagrant/plugin/manager" module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/plugin/action/install_gem.rb b/plugins/commands/plugin/action/install_gem.rb index 298205568..45766cd43 100644 --- a/plugins/commands/plugin/action/install_gem.rb +++ b/plugins/commands/plugin/action/install_gem.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "vagrant/plugin/manager" -require "vagrant/util/platform" +Vagrant.require "log4r" +Vagrant.require "vagrant/plugin/manager" +Vagrant.require "vagrant/util/platform" module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/plugin/action/license_plugin.rb b/plugins/commands/plugin/action/license_plugin.rb index 0fb605db1..11f33a2b0 100644 --- a/plugins/commands/plugin/action/license_plugin.rb +++ b/plugins/commands/plugin/action/license_plugin.rb @@ -1,12 +1,12 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" -require "pathname" -require "rubygems" -require "set" +Vagrant.require "fileutils" +Vagrant.require "pathname" +Vagrant.require "rubygems" +Vagrant.require "set" -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/plugin/action/list_plugins.rb b/plugins/commands/plugin/action/list_plugins.rb index c6471626a..c2a3560c0 100644 --- a/plugins/commands/plugin/action/list_plugins.rb +++ b/plugins/commands/plugin/action/list_plugins.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/plugin/manager" +Vagrant.require "vagrant/plugin/manager" module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/plugin/action/plugin_exists_check.rb b/plugins/commands/plugin/action/plugin_exists_check.rb index affd68f92..7c4302d61 100644 --- a/plugins/commands/plugin/action/plugin_exists_check.rb +++ b/plugins/commands/plugin/action/plugin_exists_check.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/plugin/manager" +Vagrant.require "vagrant/plugin/manager" module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/plugin/action/repair_plugins.rb b/plugins/commands/plugin/action/repair_plugins.rb index 713641f42..667da4d81 100644 --- a/plugins/commands/plugin/action/repair_plugins.rb +++ b/plugins/commands/plugin/action/repair_plugins.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/plugin/manager" +Vagrant.require "vagrant/plugin/manager" module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/plugin/action/update_gems.rb b/plugins/commands/plugin/action/update_gems.rb index 141090436..0bab71f2f 100644 --- a/plugins/commands/plugin/action/update_gems.rb +++ b/plugins/commands/plugin/action/update_gems.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/plugin/manager" +Vagrant.require "vagrant/plugin/manager" module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/plugin/command/base.rb b/plugins/commands/plugin/command/base.rb index 5ca7ec37d..27ba1d6a6 100644 --- a/plugins/commands/plugin/command/base.rb +++ b/plugins/commands/plugin/command/base.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/plugin/state_file" +Vagrant.require "vagrant/plugin/state_file" module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/plugin/command/expunge.rb b/plugins/commands/plugin/command/expunge.rb index 41fac5c8f..7cb009efe 100644 --- a/plugins/commands/plugin/command/expunge.rb +++ b/plugins/commands/plugin/command/expunge.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require_relative "base" diff --git a/plugins/commands/plugin/command/install.rb b/plugins/commands/plugin/command/install.rb index 0a80d270d..4ced60228 100644 --- a/plugins/commands/plugin/command/install.rb +++ b/plugins/commands/plugin/command/install.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require_relative "base" require_relative "mixin_install_opts" diff --git a/plugins/commands/plugin/command/license.rb b/plugins/commands/plugin/command/license.rb index b838934b4..0bf782ae3 100644 --- a/plugins/commands/plugin/command/license.rb +++ b/plugins/commands/plugin/command/license.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require_relative "base" diff --git a/plugins/commands/plugin/command/list.rb b/plugins/commands/plugin/command/list.rb index fab8a479f..8020b922f 100644 --- a/plugins/commands/plugin/command/list.rb +++ b/plugins/commands/plugin/command/list.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require_relative "base" diff --git a/plugins/commands/plugin/command/repair.rb b/plugins/commands/plugin/command/repair.rb index 8ed976749..7762d16a3 100644 --- a/plugins/commands/plugin/command/repair.rb +++ b/plugins/commands/plugin/command/repair.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require_relative "base" diff --git a/plugins/commands/plugin/command/root.rb b/plugins/commands/plugin/command/root.rb index ead0fc335..fae441f4f 100644 --- a/plugins/commands/plugin/command/root.rb +++ b/plugins/commands/plugin/command/root.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/plugin/command/uninstall.rb b/plugins/commands/plugin/command/uninstall.rb index e5ae52963..d9bba6b29 100644 --- a/plugins/commands/plugin/command/uninstall.rb +++ b/plugins/commands/plugin/command/uninstall.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require_relative "base" diff --git a/plugins/commands/plugin/command/update.rb b/plugins/commands/plugin/command/update.rb index 2a472192d..ac48177b5 100644 --- a/plugins/commands/plugin/command/update.rb +++ b/plugins/commands/plugin/command/update.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require_relative "base" require_relative "mixin_install_opts" diff --git a/plugins/commands/plugin/gem_helper.rb b/plugins/commands/plugin/gem_helper.rb index 30e7598d3..e66ee5a5a 100644 --- a/plugins/commands/plugin/gem_helper.rb +++ b/plugins/commands/plugin/gem_helper.rb @@ -1,11 +1,11 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "rubygems" -require "rubygems/config_file" -require "rubygems/gem_runner" +Vagrant.require "rubygems" +Vagrant.require "rubygems/config_file" +Vagrant.require "rubygems/gem_runner" -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/port/command.rb b/plugins/commands/port/command.rb index df36c82f6..d0411bfeb 100644 --- a/plugins/commands/port/command.rb +++ b/plugins/commands/port/command.rb @@ -3,7 +3,7 @@ require "vagrant/util/presence" -require "optparse" +Vagrant.require "optparse" module VagrantPlugins module CommandPort diff --git a/plugins/commands/powershell/command.rb b/plugins/commands/powershell/command.rb index c6e366656..dd13965c6 100644 --- a/plugins/commands/powershell/command.rb +++ b/plugins/commands/powershell/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "optparse" +Vagrant.require "optparse" require "vagrant/util/powershell" require_relative "../../communicators/winrm/helper" diff --git a/plugins/commands/provider/command.rb b/plugins/commands/provider/command.rb index ab85295a6..3202bccb7 100644 --- a/plugins/commands/provider/command.rb +++ b/plugins/commands/provider/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandProvider diff --git a/plugins/commands/provision/command.rb b/plugins/commands/provision/command.rb index 8875f6118..41156bbdb 100644 --- a/plugins/commands/provision/command.rb +++ b/plugins/commands/provision/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandProvision diff --git a/plugins/commands/push/command.rb b/plugins/commands/push/command.rb index 355922614..801a987fd 100644 --- a/plugins/commands/push/command.rb +++ b/plugins/commands/push/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandPush diff --git a/plugins/commands/rdp/command.rb b/plugins/commands/rdp/command.rb index 5d7af813d..551fda27d 100644 --- a/plugins/commands/rdp/command.rb +++ b/plugins/commands/rdp/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "optparse" +Vagrant.require "optparse" module VagrantPlugins module CommandRDP diff --git a/plugins/commands/reload/command.rb b/plugins/commands/reload/command.rb index f8bd000d7..9cb1d7583 100644 --- a/plugins/commands/reload/command.rb +++ b/plugins/commands/reload/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require "vagrant" diff --git a/plugins/commands/resume/command.rb b/plugins/commands/resume/command.rb index 39552757a..9f556510c 100644 --- a/plugins/commands/resume/command.rb +++ b/plugins/commands/resume/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' require Vagrant.source_root.join("plugins/commands/up/start_mixins") diff --git a/plugins/commands/serve/broker.rb b/plugins/commands/serve/broker.rb index 1b9e39482..674a6999e 100644 --- a/plugins/commands/serve/broker.rb +++ b/plugins/commands/serve/broker.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "singleton" -require "thread" +Vagrant.require "singleton" +Vagrant.require "thread" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/client/capability_platform.rb b/plugins/commands/serve/client/capability_platform.rb index b06348215..0c0a34966 100644 --- a/plugins/commands/serve/client/capability_platform.rb +++ b/plugins/commands/serve/client/capability_platform.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "google/protobuf/well_known_types" +Vagrant.require "google/protobuf/well_known_types" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/client/guest.rb b/plugins/commands/serve/client/guest.rb index 4da5fd29b..f57d52f2f 100644 --- a/plugins/commands/serve/client/guest.rb +++ b/plugins/commands/serve/client/guest.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "google/protobuf/well_known_types" +Vagrant.require "google/protobuf/well_known_types" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/client/target.rb b/plugins/commands/serve/client/target.rb index 3656c25cc..a4a16c942 100644 --- a/plugins/commands/serve/client/target.rb +++ b/plugins/commands/serve/client/target.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "time" +Vagrant.require "time" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/client/vagrantfile.rb b/plugins/commands/serve/client/vagrantfile.rb index 0c9e0987e..0ed18c91c 100644 --- a/plugins/commands/serve/client/vagrantfile.rb +++ b/plugins/commands/serve/client/vagrantfile.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'ostruct' +Vagrant.require 'ostruct' module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/command.rb b/plugins/commands/serve/command.rb index fe9930fc8..b4d602f18 100644 --- a/plugins/commands/serve/command.rb +++ b/plugins/commands/serve/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "optparse" +Vagrant.require "optparse" module VagrantPlugins module CommandServe @@ -25,9 +25,9 @@ module VagrantPlugins # the command is actually executed. def load_dependencies! return if @dependencies_loaded - require 'grpc' - require 'grpc/health/checker' - require 'grpc/health/v1/health_services_pb' + Vagrant.require 'grpc' + Vagrant.require 'grpc/health/checker' + Vagrant.require 'grpc/health/v1/health_services_pb' # Add conversion patches require Vagrant.source_root.join("plugins/commands/serve/util/direct_conversions.rb").to_s diff --git a/plugins/commands/serve/mappers.rb b/plugins/commands/serve/mappers.rb index fb0122b4d..b4dacaf86 100644 --- a/plugins/commands/serve/mappers.rb +++ b/plugins/commands/serve/mappers.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "digest/sha2" -require "google/protobuf/wrappers_pb" -require "google/protobuf/well_known_types" +Vagrant.require "digest/sha2" +Vagrant.require "google/protobuf/wrappers_pb" +Vagrant.require "google/protobuf/well_known_types" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/mappers/direct.rb b/plugins/commands/serve/mappers/direct.rb index e43cfaceb..c0124198e 100644 --- a/plugins/commands/serve/mappers/direct.rb +++ b/plugins/commands/serve/mappers/direct.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pp" -require "google/protobuf/well_known_types" -require "google/protobuf/wrappers_pb" +Vagrant.require "pp" +Vagrant.require "google/protobuf/well_known_types" +Vagrant.require "google/protobuf/wrappers_pb" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/mappers/internal/graph.rb b/plugins/commands/serve/mappers/internal/graph.rb index af41c7361..9b0b6593d 100644 --- a/plugins/commands/serve/mappers/internal/graph.rb +++ b/plugins/commands/serve/mappers/internal/graph.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "rgl/adjacency" -require "rgl/traversal" -require "rgl/dijkstra" -require "rgl/topsort" +Vagrant.require "rgl/adjacency" +Vagrant.require "rgl/traversal" +Vagrant.require "rgl/dijkstra" +Vagrant.require "rgl/topsort" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/mappers/known_types.rb b/plugins/commands/serve/mappers/known_types.rb index 9167b0277..cf7b3f608 100644 --- a/plugins/commands/serve/mappers/known_types.rb +++ b/plugins/commands/serve/mappers/known_types.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "google/protobuf/well_known_types" +Vagrant.require "google/protobuf/well_known_types" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/mappers/proc.rb b/plugins/commands/serve/mappers/proc.rb index 28332e35b..e248dc9b9 100644 --- a/plugins/commands/serve/mappers/proc.rb +++ b/plugins/commands/serve/mappers/proc.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "singleton" +Vagrant.require "singleton" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/mappers/wrappers.rb b/plugins/commands/serve/mappers/wrappers.rb index 2bb73322a..06652f65e 100644 --- a/plugins/commands/serve/mappers/wrappers.rb +++ b/plugins/commands/serve/mappers/wrappers.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "google/protobuf/wrappers_pb" +Vagrant.require "google/protobuf/wrappers_pb" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/service.rb b/plugins/commands/serve/service.rb index 2a9b2465d..892d39019 100644 --- a/plugins/commands/serve/service.rb +++ b/plugins/commands/serve/service.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "ostruct" +Vagrant.require "ostruct" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/service/capability_platform_service.rb b/plugins/commands/serve/service/capability_platform_service.rb index 2531b91dc..7f5615254 100644 --- a/plugins/commands/serve/service/capability_platform_service.rb +++ b/plugins/commands/serve/service/capability_platform_service.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "google/protobuf/well_known_types" +Vagrant.require "google/protobuf/well_known_types" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/service/command_service.rb b/plugins/commands/serve/service/command_service.rb index 06f614505..a56cbe827 100644 --- a/plugins/commands/serve/service/command_service.rb +++ b/plugins/commands/serve/service/command_service.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'google/protobuf/well_known_types' +Vagrant.require 'google/protobuf/well_known_types' module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/service/communicator_service.rb b/plugins/commands/serve/service/communicator_service.rb index f87e233bb..f133c7e97 100644 --- a/plugins/commands/serve/service/communicator_service.rb +++ b/plugins/commands/serve/service/communicator_service.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "google/protobuf/well_known_types" +Vagrant.require "google/protobuf/well_known_types" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/service/guest_service.rb b/plugins/commands/serve/service/guest_service.rb index d157c3c12..3b7eb7f7a 100644 --- a/plugins/commands/serve/service/guest_service.rb +++ b/plugins/commands/serve/service/guest_service.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "google/protobuf/well_known_types" +Vagrant.require "google/protobuf/well_known_types" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/service/host_service.rb b/plugins/commands/serve/service/host_service.rb index 358a014cb..19af11810 100644 --- a/plugins/commands/serve/service/host_service.rb +++ b/plugins/commands/serve/service/host_service.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "google/protobuf/well_known_types" +Vagrant.require "google/protobuf/well_known_types" module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/service/internal_service.rb b/plugins/commands/serve/service/internal_service.rb index 4145abb1c..db5bf24a7 100644 --- a/plugins/commands/serve/service/internal_service.rb +++ b/plugins/commands/serve/service/internal_service.rb @@ -1,13 +1,13 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/plugin/v2/plugin" -require "vagrant/vagrantfile" -require "vagrant/box_collection" -require "vagrant/config" -require "pathname" +Vagrant.require "vagrant/plugin/v2/plugin" +Vagrant.require "vagrant/vagrantfile" +Vagrant.require "vagrant/box_collection" +Vagrant.require "vagrant/config" +Vagrant.require "pathname" -require 'google/protobuf/well_known_types' +Vagrant.require 'google/protobuf/well_known_types' module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/util/direct_conversions.rb b/plugins/commands/serve/util/direct_conversions.rb index 01839f3da..e47b6d354 100644 --- a/plugins/commands/serve/util/direct_conversions.rb +++ b/plugins/commands/serve/util/direct_conversions.rb @@ -2,10 +2,10 @@ # SPDX-License-Identifier: BUSL-1.1 # Patch things to produce proto messages -require "pathname" -require "securerandom" -require "google/protobuf/wrappers_pb" -require "google/protobuf/well_known_types" +Vagrant.require "pathname" +Vagrant.require "securerandom" +Vagrant.require "google/protobuf/wrappers_pb" +Vagrant.require "google/protobuf/well_known_types" PROTO_LOGGER = Log4r::Logger.new("vagrant::protologger") diff --git a/plugins/commands/serve/util/exception_transformer.rb b/plugins/commands/serve/util/exception_transformer.rb index 2af4d0bb7..56992539a 100644 --- a/plugins/commands/serve/util/exception_transformer.rb +++ b/plugins/commands/serve/util/exception_transformer.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'google/protobuf/well_known_types' -require 'google/rpc/error_details_pb' +Vagrant.require 'google/protobuf/well_known_types' +Vagrant.require 'google/rpc/error_details_pb' module VagrantPlugins module CommandServe diff --git a/plugins/commands/serve/util/usage_tracker.rb b/plugins/commands/serve/util/usage_tracker.rb index 15fc62d4a..88dfcb056 100644 --- a/plugins/commands/serve/util/usage_tracker.rb +++ b/plugins/commands/serve/util/usage_tracker.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "mutex_m" +Vagrant.require "mutex_m" module VagrantPlugins module CommandServe diff --git a/plugins/commands/snapshot/command/delete.rb b/plugins/commands/snapshot/command/delete.rb index 470a906a8..dd83278c8 100644 --- a/plugins/commands/snapshot/command/delete.rb +++ b/plugins/commands/snapshot/command/delete.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandSnapshot diff --git a/plugins/commands/snapshot/command/list.rb b/plugins/commands/snapshot/command/list.rb index 7662f5d77..68639526d 100644 --- a/plugins/commands/snapshot/command/list.rb +++ b/plugins/commands/snapshot/command/list.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandSnapshot diff --git a/plugins/commands/snapshot/command/pop.rb b/plugins/commands/snapshot/command/pop.rb index c0a32d31d..7b170010d 100644 --- a/plugins/commands/snapshot/command/pop.rb +++ b/plugins/commands/snapshot/command/pop.rb @@ -1,10 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'json' -require 'optparse' - -require 'vagrant' +Vagrant.require 'json' +Vagrant.require 'optparse' require Vagrant.source_root.join("plugins/commands/up/start_mixins") diff --git a/plugins/commands/snapshot/command/push.rb b/plugins/commands/snapshot/command/push.rb index 3b860979c..005a85dd7 100644 --- a/plugins/commands/snapshot/command/push.rb +++ b/plugins/commands/snapshot/command/push.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'json' -require 'optparse' +Vagrant.require 'json' +Vagrant.require 'optparse' require_relative "push_shared" diff --git a/plugins/commands/snapshot/command/push_shared.rb b/plugins/commands/snapshot/command/push_shared.rb index c166a3685..aa080b7dd 100644 --- a/plugins/commands/snapshot/command/push_shared.rb +++ b/plugins/commands/snapshot/command/push_shared.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'json' +Vagrant.require 'json' module VagrantPlugins module CommandSnapshot diff --git a/plugins/commands/snapshot/command/restore.rb b/plugins/commands/snapshot/command/restore.rb index d9491c850..aac7a8514 100644 --- a/plugins/commands/snapshot/command/restore.rb +++ b/plugins/commands/snapshot/command/restore.rb @@ -1,9 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' - -require 'vagrant' +Vagrant.require 'optparse' require Vagrant.source_root.join("plugins/commands/up/start_mixins") diff --git a/plugins/commands/snapshot/command/root.rb b/plugins/commands/snapshot/command/root.rb index a4dad2b0d..0f8750c21 100644 --- a/plugins/commands/snapshot/command/root.rb +++ b/plugins/commands/snapshot/command/root.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandSnapshot diff --git a/plugins/commands/snapshot/command/save.rb b/plugins/commands/snapshot/command/save.rb index 3ea4b9228..11f63c2ac 100644 --- a/plugins/commands/snapshot/command/save.rb +++ b/plugins/commands/snapshot/command/save.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandSnapshot diff --git a/plugins/commands/ssh/command.rb b/plugins/commands/ssh/command.rb index 2e13f3955..95e227434 100644 --- a/plugins/commands/ssh/command.rb +++ b/plugins/commands/ssh/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandSSH diff --git a/plugins/commands/ssh_config/command.rb b/plugins/commands/ssh_config/command.rb index f00b2bed6..183800612 100644 --- a/plugins/commands/ssh_config/command.rb +++ b/plugins/commands/ssh_config/command.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' -require "vagrant/util/safe_puts" -require "vagrant/util/platform" +Vagrant.require "vagrant/util/safe_puts" +Vagrant.require "vagrant/util/platform" module VagrantPlugins module CommandSSHConfig diff --git a/plugins/commands/status/command.rb b/plugins/commands/status/command.rb index 9c4dc6230..b09495b58 100644 --- a/plugins/commands/status/command.rb +++ b/plugins/commands/status/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandStatus diff --git a/plugins/commands/suspend/command.rb b/plugins/commands/suspend/command.rb index 114c80172..727bdd8b3 100644 --- a/plugins/commands/suspend/command.rb +++ b/plugins/commands/suspend/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandSuspend diff --git a/plugins/commands/up/command.rb b/plugins/commands/up/command.rb index 1dba4515e..974b059af 100644 --- a/plugins/commands/up/command.rb +++ b/plugins/commands/up/command.rb @@ -1,10 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' -require 'set' - -require "vagrant" +Vagrant.require 'optparse' +Vagrant.require 'set' require File.expand_path("../start_mixins", __FILE__) diff --git a/plugins/commands/up/start_mixins.rb b/plugins/commands/up/start_mixins.rb index c0101d22a..f7c04fabf 100644 --- a/plugins/commands/up/start_mixins.rb +++ b/plugins/commands/up/start_mixins.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "set" +Vagrant.require "set" module VagrantPlugins module CommandUp diff --git a/plugins/commands/upload/command.rb b/plugins/commands/upload/command.rb index 2276aa3a9..5eca4e612 100644 --- a/plugins/commands/upload/command.rb +++ b/plugins/commands/upload/command.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' -require "rubygems/package" +Vagrant.require 'optparse' +Vagrant.require "rubygems/package" module VagrantPlugins module CommandUpload diff --git a/plugins/commands/validate/command.rb b/plugins/commands/validate/command.rb index e19b3bc67..f6f784595 100644 --- a/plugins/commands/validate/command.rb +++ b/plugins/commands/validate/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' module VagrantPlugins module CommandValidate @@ -59,7 +59,7 @@ module VagrantPlugins # # return [String] tmp_data_dir - Temporary dir used to store guest metadata during validation def mockup_providers! - require 'log4r' + Vagrant.require 'log4r' logger = Log4r::Logger.new("vagrant::validate") logger.debug("Overriding all registered provider classes for validate") diff --git a/plugins/commands/version/command.rb b/plugins/commands/version/command.rb index f931bd162..525e777a6 100644 --- a/plugins/commands/version/command.rb +++ b/plugins/commands/version/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "optparse" +Vagrant.require "optparse" module VagrantPlugins module CommandVersion diff --git a/plugins/commands/winrm/command.rb b/plugins/commands/winrm/command.rb index ac33709a7..73af85a47 100644 --- a/plugins/commands/winrm/command.rb +++ b/plugins/commands/winrm/command.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' - -require "vagrant/util/safe_puts" +Vagrant.require 'optparse' +Vagrant.require "vagrant/util/safe_puts" module VagrantPlugins module CommandWinRM diff --git a/plugins/commands/winrm_config/command.rb b/plugins/commands/winrm_config/command.rb index 613978ac4..8c6a78e1e 100644 --- a/plugins/commands/winrm_config/command.rb +++ b/plugins/commands/winrm_config/command.rb @@ -1,7 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' + require "vagrant/util/safe_puts" require_relative "../../communicators/winrm/helper" diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb index db5403b8e..8dfa9ccfc 100644 --- a/plugins/communicators/ssh/communicator.rb +++ b/plugins/communicators/ssh/communicator.rb @@ -1,23 +1,23 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'etc' -require 'logger' -require 'pathname' -require 'stringio' -require 'thread' -require 'timeout' +Vagrant.require 'etc' +Vagrant.require 'logger' +Vagrant.require 'pathname' +Vagrant.require 'stringio' +Vagrant.require 'thread' +Vagrant.require 'timeout' -require 'log4r' -require 'net/ssh' -require 'net/ssh/proxy/command' -require 'net/scp' +Vagrant.require 'log4r' +Vagrant.require 'net/ssh' +Vagrant.require 'net/ssh/proxy/command' +Vagrant.require 'net/scp' -require 'vagrant/util/ansi_escape_code_remover' -require 'vagrant/util/file_mode' -require 'vagrant/util/keypair' -require 'vagrant/util/platform' -require 'vagrant/util/retryable' +Vagrant.require 'vagrant/util/ansi_escape_code_remover' +Vagrant.require 'vagrant/util/file_mode' +Vagrant.require 'vagrant/util/keypair' +Vagrant.require 'vagrant/util/platform' +Vagrant.require 'vagrant/util/retryable' module VagrantPlugins module CommunicatorSSH diff --git a/plugins/communicators/winrm/command_filters/mkdir.rb b/plugins/communicators/winrm/command_filters/mkdir.rb index 09f85a39c..b53a3c481 100644 --- a/plugins/communicators/winrm/command_filters/mkdir.rb +++ b/plugins/communicators/winrm/command_filters/mkdir.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "shellwords" +Vagrant.require "shellwords" module VagrantPlugins module CommunicatorWinRM diff --git a/plugins/communicators/winrm/command_filters/rm.rb b/plugins/communicators/winrm/command_filters/rm.rb index 5c859cc7c..d68b542e7 100644 --- a/plugins/communicators/winrm/command_filters/rm.rb +++ b/plugins/communicators/winrm/command_filters/rm.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "shellwords" +Vagrant.require "shellwords" module VagrantPlugins module CommunicatorWinRM diff --git a/plugins/communicators/winrm/command_filters/test.rb b/plugins/communicators/winrm/command_filters/test.rb index 4aedecb9f..563b63a47 100644 --- a/plugins/communicators/winrm/command_filters/test.rb +++ b/plugins/communicators/winrm/command_filters/test.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "shellwords" +Vagrant.require "shellwords" module VagrantPlugins module CommunicatorWinRM diff --git a/plugins/communicators/winrm/command_filters/which.rb b/plugins/communicators/winrm/command_filters/which.rb index 0be0df326..f9c757156 100644 --- a/plugins/communicators/winrm/command_filters/which.rb +++ b/plugins/communicators/winrm/command_filters/which.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "shellwords" +Vagrant.require "shellwords" module VagrantPlugins module CommunicatorWinRM diff --git a/plugins/communicators/winrm/communicator.rb b/plugins/communicators/winrm/communicator.rb index 85c055afa..5655eecd0 100644 --- a/plugins/communicators/winrm/communicator.rb +++ b/plugins/communicators/winrm/communicator.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "tempfile" -require "timeout" +Vagrant.require "log4r" +Vagrant.require "tempfile" +Vagrant.require "timeout" require_relative "helper" require_relative "shell" diff --git a/plugins/communicators/winrm/shell.rb b/plugins/communicators/winrm/shell.rb index 1cf2d325c..91d452e88 100644 --- a/plugins/communicators/winrm/shell.rb +++ b/plugins/communicators/winrm/shell.rb @@ -1,19 +1,19 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "timeout" +Vagrant.require "timeout" -require "log4r" +Vagrant.require "log4r" -require "vagrant/util/retryable" -require "vagrant/util/silence_warnings" +Vagrant.require "vagrant/util/retryable" +Vagrant.require "vagrant/util/silence_warnings" Vagrant::Util::SilenceWarnings.silence! do - require "winrm" + Vagrant.require "winrm" end -require "winrm-elevated" -require "winrm-fs" +Vagrant.require "winrm-elevated" +Vagrant.require "winrm-fs" module VagrantPlugins module CommunicatorWinRM diff --git a/plugins/communicators/winssh/communicator.rb b/plugins/communicators/winssh/communicator.rb index 528a5bb51..914c8713a 100644 --- a/plugins/communicators/winssh/communicator.rb +++ b/plugins/communicators/winssh/communicator.rb @@ -3,7 +3,7 @@ require File.expand_path("../../ssh/communicator", __FILE__) -require 'net/sftp' +Vagrant.require "net/sftp" module VagrantPlugins module CommunicatorWinSSH diff --git a/plugins/guests/alpine/cap/configure_networks.rb b/plugins/guests/alpine/cap/configure_networks.rb index 9e38ae793..2203134d3 100644 --- a/plugins/guests/alpine/cap/configure_networks.rb +++ b/plugins/guests/alpine/cap/configure_networks.rb @@ -7,10 +7,10 @@ # # FIXME: address disabled warnings # -require 'set' -require 'tempfile' -require 'pathname' -require 'vagrant/util/template_renderer' +Vagrant.require 'set' +Vagrant.require 'tempfile' +Vagrant.require 'pathname' +Vagrant.require 'vagrant/util/template_renderer' module VagrantPlugins module GuestAlpine diff --git a/plugins/guests/alt/cap/configure_networks.rb b/plugins/guests/alt/cap/configure_networks.rb index ad31ac6ea..affa71d47 100644 --- a/plugins/guests/alt/cap/configure_networks.rb +++ b/plugins/guests/alt/cap/configure_networks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/arch/cap/configure_networks.rb b/plugins/guests/arch/cap/configure_networks.rb index 52ed72f5c..81a431b8d 100644 --- a/plugins/guests/arch/cap/configure_networks.rb +++ b/plugins/guests/arch/cap/configure_networks.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "ipaddr" -require "socket" -require "tempfile" +Vagrant.require "ipaddr" +Vagrant.require "socket" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/bsd/cap/nfs.rb b/plugins/guests/bsd/cap/nfs.rb index 811f58167..00e1a44b2 100644 --- a/plugins/guests/bsd/cap/nfs.rb +++ b/plugins/guests/bsd/cap/nfs.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "shellwords" -require "vagrant/util/retryable" +Vagrant.require "shellwords" +Vagrant.require "vagrant/util/retryable" module VagrantPlugins module GuestBSD diff --git a/plugins/guests/bsd/cap/public_key.rb b/plugins/guests/bsd/cap/public_key.rb index 875490477..30bd9927f 100644 --- a/plugins/guests/bsd/cap/public_key.rb +++ b/plugins/guests/bsd/cap/public_key.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" -require "vagrant/util/shell_quote" +Vagrant.require "vagrant/util/shell_quote" module VagrantPlugins module GuestBSD diff --git a/plugins/guests/coreos/cap/change_host_name.rb b/plugins/guests/coreos/cap/change_host_name.rb index 132e691ae..a7ab03d84 100644 --- a/plugins/guests/coreos/cap/change_host_name.rb +++ b/plugins/guests/coreos/cap/change_host_name.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" -require "yaml" +Vagrant.require "tempfile" +Vagrant.require "yaml" module VagrantPlugins module GuestCoreOS diff --git a/plugins/guests/darwin/cap/configure_networks.rb b/plugins/guests/darwin/cap/configure_networks.rb index 1155e01bd..f4d46ac75 100644 --- a/plugins/guests/darwin/cap/configure_networks.rb +++ b/plugins/guests/darwin/cap/configure_networks.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" -require "vagrant/util/template_renderer" +Vagrant.require "vagrant/util/template_renderer" module VagrantPlugins module GuestDarwin diff --git a/plugins/guests/darwin/cap/mount_smb_shared_folder.rb b/plugins/guests/darwin/cap/mount_smb_shared_folder.rb index 4cbfd24aa..028a92802 100644 --- a/plugins/guests/darwin/cap/mount_smb_shared_folder.rb +++ b/plugins/guests/darwin/cap/mount_smb_shared_folder.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/util/retryable" -require "shellwords" +Vagrant.require "vagrant/util/retryable" +Vagrant.require "shellwords" module VagrantPlugins module GuestDarwin diff --git a/plugins/guests/darwin/cap/mount_vmware_shared_folder.rb b/plugins/guests/darwin/cap/mount_vmware_shared_folder.rb index 400289c68..493d6c3b1 100644 --- a/plugins/guests/darwin/cap/mount_vmware_shared_folder.rb +++ b/plugins/guests/darwin/cap/mount_vmware_shared_folder.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "securerandom" +Vagrant.require "securerandom" module VagrantPlugins module GuestDarwin diff --git a/plugins/guests/debian/cap/change_host_name.rb b/plugins/guests/debian/cap/change_host_name.rb index 00dae5559..a67cf8303 100644 --- a/plugins/guests/debian/cap/change_host_name.rb +++ b/plugins/guests/debian/cap/change_host_name.rb @@ -1,9 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require 'vagrant/util/guest_hosts' -require 'vagrant/util/guest_inspection' +Vagrant.require "log4r" +Vagrant.require 'vagrant/util/guest_hosts' +Vagrant.require 'vagrant/util/guest_inspection' + require_relative "../../linux/cap/network_interfaces" module VagrantPlugins diff --git a/plugins/guests/debian/cap/configure_networks.rb b/plugins/guests/debian/cap/configure_networks.rb index ce18ac13a..eb9996ee7 100644 --- a/plugins/guests/debian/cap/configure_networks.rb +++ b/plugins/guests/debian/cap/configure_networks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/esxi/cap/public_key.rb b/plugins/guests/esxi/cap/public_key.rb index 23b94197a..08fdb23b5 100644 --- a/plugins/guests/esxi/cap/public_key.rb +++ b/plugins/guests/esxi/cap/public_key.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" -require "vagrant/util/shell_quote" +Vagrant.require "vagrant/util/shell_quote" module VagrantPlugins module GuestEsxi diff --git a/plugins/guests/freebsd/cap/configure_networks.rb b/plugins/guests/freebsd/cap/configure_networks.rb index 4c117805a..393d88fb2 100644 --- a/plugins/guests/freebsd/cap/configure_networks.rb +++ b/plugins/guests/freebsd/cap/configure_networks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/funtoo/cap/configure_networks.rb b/plugins/guests/funtoo/cap/configure_networks.rb index 2980c8f4a..0955352be 100644 --- a/plugins/guests/funtoo/cap/configure_networks.rb +++ b/plugins/guests/funtoo/cap/configure_networks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/gentoo/cap/configure_networks.rb b/plugins/guests/gentoo/cap/configure_networks.rb index 691dde903..8c3edac7d 100644 --- a/plugins/guests/gentoo/cap/configure_networks.rb +++ b/plugins/guests/gentoo/cap/configure_networks.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" -require "ipaddr" +Vagrant.require "tempfile" +Vagrant.require "ipaddr" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/linux/cap/mount_smb_shared_folder.rb b/plugins/guests/linux/cap/mount_smb_shared_folder.rb index af134aab9..db4d418db 100644 --- a/plugins/guests/linux/cap/mount_smb_shared_folder.rb +++ b/plugins/guests/linux/cap/mount_smb_shared_folder.rb @@ -1,8 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" -require "shellwords" +Vagrant.require "fileutils" +Vagrant.require "shellwords" + require_relative "../../../synced_folders/unix_mount_helpers" module VagrantPlugins diff --git a/plugins/guests/linux/cap/public_key.rb b/plugins/guests/linux/cap/public_key.rb index 0c0a6e335..7776c0a4e 100644 --- a/plugins/guests/linux/cap/public_key.rb +++ b/plugins/guests/linux/cap/public_key.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" -require "vagrant/util/shell_quote" +Vagrant.require "vagrant/util/shell_quote" module VagrantPlugins module GuestLinux diff --git a/plugins/guests/linux/cap/reboot.rb b/plugins/guests/linux/cap/reboot.rb index 7e7c1d4f2..f70bc1679 100644 --- a/plugins/guests/linux/cap/reboot.rb +++ b/plugins/guests/linux/cap/reboot.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'vagrant/util/guest_inspection' -require "log4r" +Vagrant.require 'vagrant/util/guest_inspection' +Vagrant.require "log4r" module VagrantPlugins module GuestLinux diff --git a/plugins/guests/netbsd/cap/configure_networks.rb b/plugins/guests/netbsd/cap/configure_networks.rb index 697e49154..17fa43b5a 100644 --- a/plugins/guests/netbsd/cap/configure_networks.rb +++ b/plugins/guests/netbsd/cap/configure_networks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/nixos/cap/change_host_name.rb b/plugins/guests/nixos/cap/change_host_name.rb index 381b373d5..4e92ad188 100644 --- a/plugins/guests/nixos/cap/change_host_name.rb +++ b/plugins/guests/nixos/cap/change_host_name.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/nixos/cap/configure_networks.rb b/plugins/guests/nixos/cap/configure_networks.rb index c4380cd32..4d369b0f2 100644 --- a/plugins/guests/nixos/cap/configure_networks.rb +++ b/plugins/guests/nixos/cap/configure_networks.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "ipaddr" -require "tempfile" +Vagrant.require "ipaddr" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/openbsd/cap/configure_networks.rb b/plugins/guests/openbsd/cap/configure_networks.rb index 3cbd34cde..7d27a6d9d 100644 --- a/plugins/guests/openbsd/cap/configure_networks.rb +++ b/plugins/guests/openbsd/cap/configure_networks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/redhat/cap/configure_networks.rb b/plugins/guests/redhat/cap/configure_networks.rb index 0f9bb3236..c7ac93538 100644 --- a/plugins/guests/redhat/cap/configure_networks.rb +++ b/plugins/guests/redhat/cap/configure_networks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/slackware/cap/configure_networks.rb b/plugins/guests/slackware/cap/configure_networks.rb index c4986e8a2..dd6d42d48 100644 --- a/plugins/guests/slackware/cap/configure_networks.rb +++ b/plugins/guests/slackware/cap/configure_networks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/suse/cap/configure_networks.rb b/plugins/guests/suse/cap/configure_networks.rb index ac98b57bf..cd02db0b9 100644 --- a/plugins/guests/suse/cap/configure_networks.rb +++ b/plugins/guests/suse/cap/configure_networks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/guests/tinycore/cap/configure_networks.rb b/plugins/guests/tinycore/cap/configure_networks.rb index 4a7ec93ae..6996c7f3d 100644 --- a/plugins/guests/tinycore/cap/configure_networks.rb +++ b/plugins/guests/tinycore/cap/configure_networks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "ipaddr" +Vagrant.require "ipaddr" module VagrantPlugins module GuestTinyCore diff --git a/plugins/guests/windows/cap/change_host_name.rb b/plugins/guests/windows/cap/change_host_name.rb index 9300ee016..34db1a7e8 100644 --- a/plugins/guests/windows/cap/change_host_name.rb +++ b/plugins/guests/windows/cap/change_host_name.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module GuestWindows diff --git a/plugins/guests/windows/cap/configure_networks.rb b/plugins/guests/windows/cap/configure_networks.rb index 3c8e0c055..492669705 100644 --- a/plugins/guests/windows/cap/configure_networks.rb +++ b/plugins/guests/windows/cap/configure_networks.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" require_relative "../guest_network" diff --git a/plugins/guests/windows/cap/mount_shared_folder.rb b/plugins/guests/windows/cap/mount_shared_folder.rb index df9d1caf5..1c6df54a2 100644 --- a/plugins/guests/windows/cap/mount_shared_folder.rb +++ b/plugins/guests/windows/cap/mount_shared_folder.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/util/template_renderer" -require "base64" +Vagrant.require "vagrant/util/template_renderer" +Vagrant.require "base64" module VagrantPlugins module GuestWindows diff --git a/plugins/guests/windows/cap/public_key.rb b/plugins/guests/windows/cap/public_key.rb index 0316cec7f..54af10ae3 100644 --- a/plugins/guests/windows/cap/public_key.rb +++ b/plugins/guests/windows/cap/public_key.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative '../../../communicators/winssh/communicator' diff --git a/plugins/guests/windows/cap/reboot.rb b/plugins/guests/windows/cap/reboot.rb index 029406c34..3946a5a82 100644 --- a/plugins/guests/windows/cap/reboot.rb +++ b/plugins/guests/windows/cap/reboot.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module GuestWindows diff --git a/plugins/guests/windows/guest_network.rb b/plugins/guests/windows/guest_network.rb index 75f5f8fe7..f5c1cd116 100644 --- a/plugins/guests/windows/guest_network.rb +++ b/plugins/guests/windows/guest_network.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module GuestWindows diff --git a/plugins/hosts/bsd/cap/nfs.rb b/plugins/hosts/bsd/cap/nfs.rb index 60794d85d..5732a6c85 100644 --- a/plugins/hosts/bsd/cap/nfs.rb +++ b/plugins/hosts/bsd/cap/nfs.rb @@ -1,11 +1,11 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" -require "vagrant/util" -require "vagrant/util/shell_quote" -require "vagrant/util/which" +Vagrant.require "vagrant/util" +Vagrant.require "vagrant/util/shell_quote" +Vagrant.require "vagrant/util/which" module VagrantPlugins module HostBSD diff --git a/plugins/hosts/darwin/cap/configured_ip_addresses.rb b/plugins/hosts/darwin/cap/configured_ip_addresses.rb index 1c0aec830..b3e8ca968 100644 --- a/plugins/hosts/darwin/cap/configured_ip_addresses.rb +++ b/plugins/hosts/darwin/cap/configured_ip_addresses.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "socket" +Vagrant.require "socket" module VagrantPlugins module HostDarwin diff --git a/plugins/hosts/darwin/cap/fs_iso.rb b/plugins/hosts/darwin/cap/fs_iso.rb index e7aa7a5ec..65c88afd6 100644 --- a/plugins/hosts/darwin/cap/fs_iso.rb +++ b/plugins/hosts/darwin/cap/fs_iso.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "vagrant/util/caps" +Vagrant.require "pathname" +Vagrant.require "vagrant/util/caps" module VagrantPlugins module HostDarwin diff --git a/plugins/hosts/darwin/cap/provider_install_virtualbox.rb b/plugins/hosts/darwin/cap/provider_install_virtualbox.rb index dc8c0f7a7..e6b5b4837 100644 --- a/plugins/hosts/darwin/cap/provider_install_virtualbox.rb +++ b/plugins/hosts/darwin/cap/provider_install_virtualbox.rb @@ -1,12 +1,12 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "tempfile" +Vagrant.require "pathname" +Vagrant.require "tempfile" -require "vagrant/util/downloader" -require "vagrant/util/file_checksum" -require "vagrant/util/subprocess" +Vagrant.require "vagrant/util/downloader" +Vagrant.require "vagrant/util/file_checksum" +Vagrant.require "vagrant/util/subprocess" module VagrantPlugins module HostDarwin diff --git a/plugins/hosts/darwin/cap/rdp.rb b/plugins/hosts/darwin/cap/rdp.rb index 27e526932..8fc05f310 100644 --- a/plugins/hosts/darwin/cap/rdp.rb +++ b/plugins/hosts/darwin/cap/rdp.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "tmpdir" +Vagrant.require "pathname" +Vagrant.require "tmpdir" -require "vagrant/util/subprocess" +Vagrant.require "vagrant/util/subprocess" module VagrantPlugins module HostDarwin diff --git a/plugins/hosts/linux/cap/fs_iso.rb b/plugins/hosts/linux/cap/fs_iso.rb index 6c7bc63c9..91016813f 100644 --- a/plugins/hosts/linux/cap/fs_iso.rb +++ b/plugins/hosts/linux/cap/fs_iso.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "vagrant/util/caps" +Vagrant.require "pathname" +Vagrant.require "vagrant/util/caps" module VagrantPlugins module HostLinux diff --git a/plugins/hosts/linux/cap/nfs.rb b/plugins/hosts/linux/cap/nfs.rb index f2732c58b..f6845bf2d 100644 --- a/plugins/hosts/linux/cap/nfs.rb +++ b/plugins/hosts/linux/cap/nfs.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "shellwords" -require "vagrant/util" -require "vagrant/util/shell_quote" -require "vagrant/util/retryable" +Vagrant.require "shellwords" +Vagrant.require "vagrant/util" +Vagrant.require "vagrant/util/shell_quote" +Vagrant.require "vagrant/util/retryable" module VagrantPlugins module HostLinux diff --git a/plugins/hosts/linux/cap/rdp.rb b/plugins/hosts/linux/cap/rdp.rb index 834c3c056..f394fc83e 100644 --- a/plugins/hosts/linux/cap/rdp.rb +++ b/plugins/hosts/linux/cap/rdp.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "vagrant/util/which" +Vagrant.require "vagrant/util/which" module VagrantPlugins module HostLinux diff --git a/plugins/hosts/redhat/cap/nfs.rb b/plugins/hosts/redhat/cap/nfs.rb index 83e8938ce..0f0e6d65c 100644 --- a/plugins/hosts/redhat/cap/nfs.rb +++ b/plugins/hosts/redhat/cap/nfs.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" +Vagrant.require "pathname" module VagrantPlugins module HostRedHat diff --git a/plugins/hosts/redhat/host.rb b/plugins/hosts/redhat/host.rb index 73a0553a6..bf242f50a 100644 --- a/plugins/hosts/redhat/host.rb +++ b/plugins/hosts/redhat/host.rb @@ -1,9 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" - -require "vagrant" +Vagrant.require "pathname" module VagrantPlugins module HostRedHat diff --git a/plugins/hosts/suse/host.rb b/plugins/hosts/suse/host.rb index b69ea7a00..040b074ca 100644 --- a/plugins/hosts/suse/host.rb +++ b/plugins/hosts/suse/host.rb @@ -1,9 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" - -require "vagrant" +Vagrant.require "pathname" module VagrantPlugins module HostSUSE diff --git a/plugins/hosts/void/host.rb b/plugins/hosts/void/host.rb index e1343a073..d94074e78 100644 --- a/plugins/hosts/void/host.rb +++ b/plugins/hosts/void/host.rb @@ -1,9 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'pathname' - -require 'vagrant' +Vagrant.require 'pathname' module VagrantPlugins module HostVoid diff --git a/plugins/hosts/windows/cap/configured_ip_addresses.rb b/plugins/hosts/windows/cap/configured_ip_addresses.rb index 664525653..536a3310f 100644 --- a/plugins/hosts/windows/cap/configured_ip_addresses.rb +++ b/plugins/hosts/windows/cap/configured_ip_addresses.rb @@ -1,13 +1,13 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "tempfile" +Vagrant.require "pathname" +Vagrant.require "tempfile" -require "vagrant/util/downloader" -require "vagrant/util/file_checksum" -require "vagrant/util/powershell" -require "vagrant/util/subprocess" +Vagrant.require "vagrant/util/downloader" +Vagrant.require "vagrant/util/file_checksum" +Vagrant.require "vagrant/util/powershell" +Vagrant.require "vagrant/util/subprocess" module VagrantPlugins module HostWindows diff --git a/plugins/hosts/windows/cap/fs_iso.rb b/plugins/hosts/windows/cap/fs_iso.rb index 24542601a..cf95639d3 100644 --- a/plugins/hosts/windows/cap/fs_iso.rb +++ b/plugins/hosts/windows/cap/fs_iso.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "vagrant/util/caps" +Vagrant.require "pathname" +Vagrant.require "vagrant/util/caps" module VagrantPlugins module HostWindows diff --git a/plugins/hosts/windows/cap/provider_install_virtualbox.rb b/plugins/hosts/windows/cap/provider_install_virtualbox.rb index 2f74af084..569037b6b 100644 --- a/plugins/hosts/windows/cap/provider_install_virtualbox.rb +++ b/plugins/hosts/windows/cap/provider_install_virtualbox.rb @@ -1,13 +1,13 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "tempfile" +Vagrant.require "pathname" +Vagrant.require "tempfile" -require "vagrant/util/downloader" -require "vagrant/util/file_checksum" -require "vagrant/util/powershell" -require "vagrant/util/subprocess" +Vagrant.require "vagrant/util/downloader" +Vagrant.require "vagrant/util/file_checksum" +Vagrant.require "vagrant/util/powershell" +Vagrant.require "vagrant/util/subprocess" module VagrantPlugins module HostWindows diff --git a/plugins/hosts/windows/cap/ps.rb b/plugins/hosts/windows/cap/ps.rb index 41cba15d3..79a5fec9e 100644 --- a/plugins/hosts/windows/cap/ps.rb +++ b/plugins/hosts/windows/cap/ps.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "tmpdir" +Vagrant.require "pathname" +Vagrant.require "tmpdir" -require "vagrant/util/safe_exec" +Vagrant.require "vagrant/util/safe_exec" module VagrantPlugins module HostWindows diff --git a/plugins/hosts/windows/cap/rdp.rb b/plugins/hosts/windows/cap/rdp.rb index 547fcb007..7e34ea68a 100644 --- a/plugins/hosts/windows/cap/rdp.rb +++ b/plugins/hosts/windows/cap/rdp.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "tmpdir" +Vagrant.require "pathname" +Vagrant.require "tmpdir" -require "vagrant/util/subprocess" +Vagrant.require "vagrant/util/subprocess" module VagrantPlugins module HostWindows diff --git a/plugins/kernel_v2/config/cloud_init.rb b/plugins/kernel_v2/config/cloud_init.rb index 435060cd3..bb39f2c5a 100644 --- a/plugins/kernel_v2/config/cloud_init.rb +++ b/plugins/kernel_v2/config/cloud_init.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "securerandom" +Vagrant.require "log4r" +Vagrant.require "securerandom" module VagrantPlugins module Kernel_V2 diff --git a/plugins/kernel_v2/config/disk.rb b/plugins/kernel_v2/config/disk.rb index 8051508b6..704c5735d 100644 --- a/plugins/kernel_v2/config/disk.rb +++ b/plugins/kernel_v2/config/disk.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "securerandom" +Vagrant.require "log4r" +Vagrant.require "securerandom" -require "vagrant/util/numeric" +Vagrant.require "vagrant/util/numeric" module VagrantPlugins module Kernel_V2 diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index 96980d1e1..95877d6de 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -1,17 +1,17 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "securerandom" -require "set" +Vagrant.require "pathname" +Vagrant.require "securerandom" +Vagrant.require "set" -require "vagrant" -require "vagrant/action/builtin/mixin_synced_folders" -require "vagrant/config/v2/util" -require "vagrant/util/platform" -require "vagrant/util/presence" -require "vagrant/util/experimental" -require "vagrant/util/map_command_options" +Vagrant.require "vagrant" +Vagrant.require "vagrant/action/builtin/mixin_synced_folders" +Vagrant.require "vagrant/config/v2/util" +Vagrant.require "vagrant/util/platform" +Vagrant.require "vagrant/util/presence" +Vagrant.require "vagrant/util/experimental" +Vagrant.require "vagrant/util/map_command_options" require File.expand_path("../vm_provisioner", __FILE__) require File.expand_path("../vm_subvm", __FILE__) diff --git a/plugins/kernel_v2/config/vm_provisioner.rb b/plugins/kernel_v2/config/vm_provisioner.rb index 89abf8509..6e6464df2 100644 --- a/plugins/kernel_v2/config/vm_provisioner.rb +++ b/plugins/kernel_v2/config/vm_provisioner.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'log4r' +Vagrant.require 'log4r' module VagrantPlugins module Kernel_V2 diff --git a/plugins/kernel_v2/config/vm_trigger.rb b/plugins/kernel_v2/config/vm_trigger.rb index 2649f210a..deb0a603f 100644 --- a/plugins/kernel_v2/config/vm_trigger.rb +++ b/plugins/kernel_v2/config/vm_trigger.rb @@ -1,8 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "securerandom" +Vagrant.require "log4r" +Vagrant.require "securerandom" + require Vagrant.source_root.join("plugins/provisioners/shell/config") module VagrantPlugins diff --git a/plugins/providers/docker/action/build.rb b/plugins/providers/docker/action/build.rb index b56c1b54b..82f22df6e 100644 --- a/plugins/providers/docker/action/build.rb +++ b/plugins/providers/docker/action/build.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" -require "vagrant/util/ansi_escape_code_remover" +Vagrant.require "vagrant/util/ansi_escape_code_remover" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/action/connect_networks.rb b/plugins/providers/docker/action/connect_networks.rb index c2d67e9a7..3a116fbca 100644 --- a/plugins/providers/docker/action/connect_networks.rb +++ b/plugins/providers/docker/action/connect_networks.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'ipaddr' -require 'log4r' +Vagrant.require 'ipaddr' +Vagrant.require 'log4r' -require 'vagrant/util/scoped_hash_override' +Vagrant.require 'vagrant/util/scoped_hash_override' module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/action/destroy_build_image.rb b/plugins/providers/docker/action/destroy_build_image.rb index e28b6c4a7..b0696fc62 100644 --- a/plugins/providers/docker/action/destroy_build_image.rb +++ b/plugins/providers/docker/action/destroy_build_image.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/action/destroy_network.rb b/plugins/providers/docker/action/destroy_network.rb index 86131cde6..e11b12298 100644 --- a/plugins/providers/docker/action/destroy_network.rb +++ b/plugins/providers/docker/action/destroy_network.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'log4r' +Vagrant.require 'log4r' module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/action/host_machine.rb b/plugins/providers/docker/action/host_machine.rb index 460ad41fd..a5f0f417a 100644 --- a/plugins/providers/docker/action/host_machine.rb +++ b/plugins/providers/docker/action/host_machine.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/action/host_machine_build_dir.rb b/plugins/providers/docker/action/host_machine_build_dir.rb index 79056ed72..6b981fc38 100644 --- a/plugins/providers/docker/action/host_machine_build_dir.rb +++ b/plugins/providers/docker/action/host_machine_build_dir.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "digest/md5" - -require "log4r" +Vagrant.require "digest/md5" +Vagrant.require "log4r" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/action/host_machine_sync_folders.rb b/plugins/providers/docker/action/host_machine_sync_folders.rb index 2374ea48e..2ad15d7a5 100644 --- a/plugins/providers/docker/action/host_machine_sync_folders.rb +++ b/plugins/providers/docker/action/host_machine_sync_folders.rb @@ -1,12 +1,11 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "digest/md5" -require "securerandom" +Vagrant.require "digest/md5" +Vagrant.require "securerandom" +Vagrant.require "log4r" -require "log4r" - -require "vagrant/action/builtin/mixin_synced_folders" +Vagrant.require "vagrant/action/builtin/mixin_synced_folders" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/action/host_machine_sync_folders_disable.rb b/plugins/providers/docker/action/host_machine_sync_folders_disable.rb index 639af8b12..463faa852 100644 --- a/plugins/providers/docker/action/host_machine_sync_folders_disable.rb +++ b/plugins/providers/docker/action/host_machine_sync_folders_disable.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" -require "vagrant/action/builtin/mixin_synced_folders" +Vagrant.require "vagrant/action/builtin/mixin_synced_folders" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/action/login.rb b/plugins/providers/docker/action/login.rb index 02a5b18d5..29325a1a0 100644 --- a/plugins/providers/docker/action/login.rb +++ b/plugins/providers/docker/action/login.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/action/prepare_networks.rb b/plugins/providers/docker/action/prepare_networks.rb index 2723d4cad..3d44adc54 100644 --- a/plugins/providers/docker/action/prepare_networks.rb +++ b/plugins/providers/docker/action/prepare_networks.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'ipaddr' -require 'log4r' +Vagrant.require 'ipaddr' +Vagrant.require 'log4r' -require 'vagrant/util/scoped_hash_override' +Vagrant.require 'vagrant/util/scoped_hash_override' module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/action/wait_for_running.rb b/plugins/providers/docker/action/wait_for_running.rb index 237cfe455..3863865d0 100644 --- a/plugins/providers/docker/action/wait_for_running.rb +++ b/plugins/providers/docker/action/wait_for_running.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "thread" - -require "log4r" +Vagrant.require "thread" +Vagrant.require "log4r" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/communicator.rb b/plugins/providers/docker/communicator.rb index 1e13485db..81dcdf379 100644 --- a/plugins/providers/docker/communicator.rb +++ b/plugins/providers/docker/communicator.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "digest/md5" -require "tempfile" +Vagrant.require "digest/md5" +Vagrant.require "tempfile" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/config.rb b/plugins/providers/docker/config.rb index dfababb53..3b7682b44 100644 --- a/plugins/providers/docker/config.rb +++ b/plugins/providers/docker/config.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" +Vagrant.require "pathname" require_relative "../../../lib/vagrant/util/platform" diff --git a/plugins/providers/docker/driver.rb b/plugins/providers/docker/driver.rb index 460c744e0..f71ec1673 100644 --- a/plugins/providers/docker/driver.rb +++ b/plugins/providers/docker/driver.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "json" -require "log4r" +Vagrant.require "json" +Vagrant.require "log4r" require_relative "./driver/compose" diff --git a/plugins/providers/docker/driver/compose.rb b/plugins/providers/docker/driver/compose.rb index 64a59b16f..2b1d42307 100644 --- a/plugins/providers/docker/driver/compose.rb +++ b/plugins/providers/docker/driver/compose.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "json" -require "log4r" +Vagrant.require "json" +Vagrant.require "log4r" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/provider.rb b/plugins/providers/docker/provider.rb index 3efac65a2..f14effda6 100644 --- a/plugins/providers/docker/provider.rb +++ b/plugins/providers/docker/provider.rb @@ -1,13 +1,12 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "digest/md5" -require "fileutils" -require "thread" +Vagrant.require "digest/md5" +Vagrant.require "fileutils" +Vagrant.require "thread" +Vagrant.require "log4r" -require "log4r" - -require "vagrant/util/silence_warnings" +Vagrant.require "vagrant/util/silence_warnings" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/hyperv/action/check_enabled.rb b/plugins/providers/hyperv/action/check_enabled.rb index 547aa459b..ac3e3ff6a 100644 --- a/plugins/providers/hyperv/action/check_enabled.rb +++ b/plugins/providers/hyperv/action/check_enabled.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" - -require "log4r" +Vagrant.require "fileutils" +Vagrant.require "log4r" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/action/configure.rb b/plugins/providers/hyperv/action/configure.rb index 6958fd455..207271a91 100644 --- a/plugins/providers/hyperv/action/configure.rb +++ b/plugins/providers/hyperv/action/configure.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" - -require "log4r" +Vagrant.require "fileutils" +Vagrant.require "log4r" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/action/export.rb b/plugins/providers/hyperv/action/export.rb index 1d1574077..2950ef83a 100644 --- a/plugins/providers/hyperv/action/export.rb +++ b/plugins/providers/hyperv/action/export.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" +Vagrant.require "fileutils" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/action/import.rb b/plugins/providers/hyperv/action/import.rb index f901d1af9..e592c07a7 100644 --- a/plugins/providers/hyperv/action/import.rb +++ b/plugins/providers/hyperv/action/import.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" -require "log4r" +Vagrant.require "fileutils" +Vagrant.require "log4r" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/action/package_metadata_json.rb b/plugins/providers/hyperv/action/package_metadata_json.rb index d874d4385..f474acd4f 100644 --- a/plugins/providers/hyperv/action/package_metadata_json.rb +++ b/plugins/providers/hyperv/action/package_metadata_json.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "json" +Vagrant.require "json" #require 'vagrant/util/template_renderer' diff --git a/plugins/providers/hyperv/action/package_setup_folders.rb b/plugins/providers/hyperv/action/package_setup_folders.rb index e6b0147be..2166c341a 100644 --- a/plugins/providers/hyperv/action/package_setup_folders.rb +++ b/plugins/providers/hyperv/action/package_setup_folders.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" +Vagrant.require "fileutils" require_relative "../../../../lib/vagrant/action/general/package_setup_folders" diff --git a/plugins/providers/hyperv/action/read_guest_ip.rb b/plugins/providers/hyperv/action/read_guest_ip.rb index 93f0a3e91..986748467 100644 --- a/plugins/providers/hyperv/action/read_guest_ip.rb +++ b/plugins/providers/hyperv/action/read_guest_ip.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "timeout" +Vagrant.require "log4r" +Vagrant.require "timeout" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/action/read_state.rb b/plugins/providers/hyperv/action/read_state.rb index 7243da433..4fa820c2a 100644 --- a/plugins/providers/hyperv/action/read_state.rb +++ b/plugins/providers/hyperv/action/read_state.rb @@ -1,8 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 - -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/action/set_name.rb b/plugins/providers/hyperv/action/set_name.rb index 86e8b9817..ca108935c 100644 --- a/plugins/providers/hyperv/action/set_name.rb +++ b/plugins/providers/hyperv/action/set_name.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/action/wait_for_ip_address.rb b/plugins/providers/hyperv/action/wait_for_ip_address.rb index 9ded3031b..af4371e12 100644 --- a/plugins/providers/hyperv/action/wait_for_ip_address.rb +++ b/plugins/providers/hyperv/action/wait_for_ip_address.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "ipaddr" -require "timeout" +Vagrant.require "ipaddr" +Vagrant.require "timeout" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/cap/cleanup_disks.rb b/plugins/providers/hyperv/cap/cleanup_disks.rb index 1dcc1f2db..aee2e3875 100644 --- a/plugins/providers/hyperv/cap/cleanup_disks.rb +++ b/plugins/providers/hyperv/cap/cleanup_disks.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "vagrant/util/experimental" +Vagrant.require "log4r" +Vagrant.require "vagrant/util/experimental" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/cap/configure_disks.rb b/plugins/providers/hyperv/cap/configure_disks.rb index f6a42e20b..0655e2333 100644 --- a/plugins/providers/hyperv/cap/configure_disks.rb +++ b/plugins/providers/hyperv/cap/configure_disks.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "fileutils" -require "vagrant/util/numeric" -require "vagrant/util/experimental" +Vagrant.require "log4r" +Vagrant.require "fileutils" +Vagrant.require "vagrant/util/numeric" +Vagrant.require "vagrant/util/experimental" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/cap/validate_disk_ext.rb b/plugins/providers/hyperv/cap/validate_disk_ext.rb index 208643e72..d29d218a3 100644 --- a/plugins/providers/hyperv/cap/validate_disk_ext.rb +++ b/plugins/providers/hyperv/cap/validate_disk_ext.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/driver.rb b/plugins/providers/hyperv/driver.rb index 23395bc16..a312f8fc1 100644 --- a/plugins/providers/hyperv/driver.rb +++ b/plugins/providers/hyperv/driver.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "json" -require "log4r" +Vagrant.require "json" +Vagrant.require "log4r" -require "vagrant/util/powershell" +Vagrant.require "vagrant/util/powershell" require_relative "plugin" diff --git a/plugins/providers/hyperv/provider.rb b/plugins/providers/hyperv/provider.rb index f23224236..52b32e1f7 100644 --- a/plugins/providers/hyperv/provider.rb +++ b/plugins/providers/hyperv/provider.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" require_relative "driver" require_relative "plugin" diff --git a/plugins/providers/virtualbox/action/check_guest_additions.rb b/plugins/providers/virtualbox/action/check_guest_additions.rb index 6cdc4c684..53a63f2e9 100644 --- a/plugins/providers/virtualbox/action/check_guest_additions.rb +++ b/plugins/providers/virtualbox/action/check_guest_additions.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/clean_machine_folder.rb b/plugins/providers/virtualbox/action/clean_machine_folder.rb index fd278a6a5..9fa026eca 100644 --- a/plugins/providers/virtualbox/action/clean_machine_folder.rb +++ b/plugins/providers/virtualbox/action/clean_machine_folder.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" +Vagrant.require "fileutils" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/destroy_unused_network_interfaces.rb b/plugins/providers/virtualbox/action/destroy_unused_network_interfaces.rb index 20091d6b2..b6669ad01 100644 --- a/plugins/providers/virtualbox/action/destroy_unused_network_interfaces.rb +++ b/plugins/providers/virtualbox/action/destroy_unused_network_interfaces.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/export.rb b/plugins/providers/virtualbox/action/export.rb index a1d27112c..5098c820c 100644 --- a/plugins/providers/virtualbox/action/export.rb +++ b/plugins/providers/virtualbox/action/export.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" -require 'vagrant/util/platform' +Vagrant.require "fileutils" +Vagrant.require 'vagrant/util/platform' module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/import_master.rb b/plugins/providers/virtualbox/action/import_master.rb index 7e70b94b3..58f7ebd04 100644 --- a/plugins/providers/virtualbox/action/import_master.rb +++ b/plugins/providers/virtualbox/action/import_master.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" - -require "digest/md5" +Vagrant.require "log4r" +Vagrant.require "digest/md5" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/network.rb b/plugins/providers/virtualbox/action/network.rb index 13342932a..08799c320 100644 --- a/plugins/providers/virtualbox/action/network.rb +++ b/plugins/providers/virtualbox/action/network.rb @@ -1,14 +1,14 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "ipaddr" -require "resolv" -require "set" +Vagrant.require "ipaddr" +Vagrant.require "resolv" +Vagrant.require "set" -require "log4r" +Vagrant.require "log4r" -require "vagrant/util/network_ip" -require "vagrant/util/scoped_hash_override" +Vagrant.require "vagrant/util/network_ip" +Vagrant.require "vagrant/util/scoped_hash_override" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/network_fix_ipv6.rb b/plugins/providers/virtualbox/action/network_fix_ipv6.rb index 2de31b57d..e1abe8452 100644 --- a/plugins/providers/virtualbox/action/network_fix_ipv6.rb +++ b/plugins/providers/virtualbox/action/network_fix_ipv6.rb @@ -1,13 +1,13 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "ipaddr" -require "socket" +Vagrant.require "ipaddr" +Vagrant.require "socket" -require "log4r" +Vagrant.require "log4r" -require "vagrant/util/presence" -require "vagrant/util/scoped_hash_override" +Vagrant.require "vagrant/util/presence" +Vagrant.require "vagrant/util/scoped_hash_override" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/package_setup_folders.rb b/plugins/providers/virtualbox/action/package_setup_folders.rb index 9be34e6a5..69eec8abf 100644 --- a/plugins/providers/virtualbox/action/package_setup_folders.rb +++ b/plugins/providers/virtualbox/action/package_setup_folders.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" +Vagrant.require "fileutils" require_relative "../../../../lib/vagrant/action/general/package_setup_folders" diff --git a/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb b/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb index b40b81b29..8b9c113d0 100644 --- a/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb +++ b/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" - -require "digest/md5" +Vagrant.require "log4r" +Vagrant.require "digest/md5" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/prepare_nfs_settings.rb b/plugins/providers/virtualbox/action/prepare_nfs_settings.rb index f8dc98563..4c4772f4f 100644 --- a/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +++ b/plugins/providers/virtualbox/action/prepare_nfs_settings.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "ipaddr" -require "vagrant/action/builtin/mixin_synced_folders" +Vagrant.require "ipaddr" +Vagrant.require "vagrant/action/builtin/mixin_synced_folders" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/sane_defaults.rb b/plugins/providers/virtualbox/action/sane_defaults.rb index 6b4a0d8ab..212a31a0c 100644 --- a/plugins/providers/virtualbox/action/sane_defaults.rb +++ b/plugins/providers/virtualbox/action/sane_defaults.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/set_default_nic_type.rb b/plugins/providers/virtualbox/action/set_default_nic_type.rb index 514fca67d..057307383 100644 --- a/plugins/providers/virtualbox/action/set_default_nic_type.rb +++ b/plugins/providers/virtualbox/action/set_default_nic_type.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/set_name.rb b/plugins/providers/virtualbox/action/set_name.rb index 491c74561..17a3e2f43 100644 --- a/plugins/providers/virtualbox/action/set_name.rb +++ b/plugins/providers/virtualbox/action/set_name.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/setup_package_files.rb b/plugins/providers/virtualbox/action/setup_package_files.rb index 76d76439b..179233dc4 100644 --- a/plugins/providers/virtualbox/action/setup_package_files.rb +++ b/plugins/providers/virtualbox/action/setup_package_files.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" require_relative "package_setup_files" diff --git a/plugins/providers/virtualbox/cap/cleanup_disks.rb b/plugins/providers/virtualbox/cap/cleanup_disks.rb index ca4aecb89..0d6918bfa 100644 --- a/plugins/providers/virtualbox/cap/cleanup_disks.rb +++ b/plugins/providers/virtualbox/cap/cleanup_disks.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "vagrant/util/experimental" +Vagrant.require "log4r" +Vagrant.require "vagrant/util/experimental" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/cap/configure_disks.rb b/plugins/providers/virtualbox/cap/configure_disks.rb index 501a6354a..365fdb316 100644 --- a/plugins/providers/virtualbox/cap/configure_disks.rb +++ b/plugins/providers/virtualbox/cap/configure_disks.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "fileutils" -require "vagrant/util/numeric" -require "vagrant/util/experimental" +Vagrant.require "log4r" +Vagrant.require "fileutils" +Vagrant.require "vagrant/util/numeric" +Vagrant.require "vagrant/util/experimental" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/cap/validate_disk_ext.rb b/plugins/providers/virtualbox/cap/validate_disk_ext.rb index 00f3d0efc..2f5f87058 100644 --- a/plugins/providers/virtualbox/cap/validate_disk_ext.rb +++ b/plugins/providers/virtualbox/cap/validate_disk_ext.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/driver/base.rb b/plugins/providers/virtualbox/driver/base.rb index 7d1739ba2..ea229b640 100644 --- a/plugins/providers/virtualbox/driver/base.rb +++ b/plugins/providers/virtualbox/driver/base.rb @@ -1,13 +1,13 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'log4r' +Vagrant.require 'log4r' -require 'vagrant/util/busy' -require 'vagrant/util/platform' -require 'vagrant/util/retryable' -require 'vagrant/util/subprocess' -require 'vagrant/util/which' +Vagrant.require 'vagrant/util/busy' +Vagrant.require 'vagrant/util/platform' +Vagrant.require 'vagrant/util/retryable' +Vagrant.require 'vagrant/util/subprocess' +Vagrant.require 'vagrant/util/which' module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/driver/version_4_1.rb b/plugins/providers/virtualbox/driver/version_4_1.rb index cfeaf825e..a892ab3b5 100644 --- a/plugins/providers/virtualbox/driver/version_4_1.rb +++ b/plugins/providers/virtualbox/driver/version_4_1.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'log4r' - -require "vagrant/util/platform" +Vagrant.require 'log4r' +Vagrant.require "vagrant/util/platform" require File.expand_path("../base", __FILE__) diff --git a/plugins/providers/virtualbox/driver/version_7_0.rb b/plugins/providers/virtualbox/driver/version_7_0.rb index a852841d7..e6e1b473c 100644 --- a/plugins/providers/virtualbox/driver/version_7_0.rb +++ b/plugins/providers/virtualbox/driver/version_7_0.rb @@ -1,7 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "rexml" +Vagrant.require "rexml" + require File.expand_path("../version_6_1", __FILE__) module VagrantPlugins diff --git a/plugins/providers/virtualbox/provider.rb b/plugins/providers/virtualbox/provider.rb index de934c072..16abd44ff 100644 --- a/plugins/providers/virtualbox/provider.rb +++ b/plugins/providers/virtualbox/provider.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/synced_folder.rb b/plugins/providers/virtualbox/synced_folder.rb index 623d0f9e1..771de1c74 100644 --- a/plugins/providers/virtualbox/synced_folder.rb +++ b/plugins/providers/virtualbox/synced_folder.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" -require "vagrant/util/platform" +Vagrant.require "fileutils" +Vagrant.require "vagrant/util/platform" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/provisioners/ansible/provisioner/guest.rb b/plugins/provisioners/ansible/provisioner/guest.rb index e4bf53eec..9727037e5 100644 --- a/plugins/provisioners/ansible/provisioner/guest.rb +++ b/plugins/provisioners/ansible/provisioner/guest.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "base" diff --git a/plugins/provisioners/ansible/provisioner/host.rb b/plugins/provisioners/ansible/provisioner/host.rb index 9f9dc5d0d..577be9bff 100644 --- a/plugins/provisioners/ansible/provisioner/host.rb +++ b/plugins/provisioners/ansible/provisioner/host.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "thread" +Vagrant.require "thread" require_relative "base" diff --git a/plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb b/plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb index bc1ec929e..fc543f773 100644 --- a/plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb +++ b/plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module CFEngine diff --git a/plugins/provisioners/cfengine/cap/redhat/cfengine_install.rb b/plugins/provisioners/cfengine/cap/redhat/cfengine_install.rb index 6c7533598..b77e4d866 100644 --- a/plugins/provisioners/cfengine/cap/redhat/cfengine_install.rb +++ b/plugins/provisioners/cfengine/cap/redhat/cfengine_install.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module CFEngine diff --git a/plugins/provisioners/cfengine/config.rb b/plugins/provisioners/cfengine/config.rb index 28d19880b..57ca872fb 100644 --- a/plugins/provisioners/cfengine/config.rb +++ b/plugins/provisioners/cfengine/config.rb @@ -1,9 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" - -require "vagrant" +Vagrant.require "pathname" module VagrantPlugins module CFEngine diff --git a/plugins/provisioners/cfengine/provisioner.rb b/plugins/provisioners/cfengine/provisioner.rb index 7db51932c..66dcddc99 100644 --- a/plugins/provisioners/cfengine/provisioner.rb +++ b/plugins/provisioners/cfengine/provisioner.rb @@ -1,8 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require "vagrant" +Vagrant.require "log4r" module VagrantPlugins module CFEngine diff --git a/plugins/provisioners/chef/plugin.rb b/plugins/provisioners/chef/plugin.rb index 24d6f01a6..df450767b 100644 --- a/plugins/provisioners/chef/plugin.rb +++ b/plugins/provisioners/chef/plugin.rb @@ -1,9 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" - -require "vagrant" +Vagrant.require "pathname" require_relative "command_builder" diff --git a/plugins/provisioners/chef/provisioner/base.rb b/plugins/provisioners/chef/provisioner/base.rb index fad7574b1..042123a42 100644 --- a/plugins/provisioners/chef/provisioner/base.rb +++ b/plugins/provisioners/chef/provisioner/base.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "tempfile" +Vagrant.require "tempfile" require_relative "../../../../lib/vagrant/util/presence" require_relative "../../../../lib/vagrant/util/template_renderer" diff --git a/plugins/provisioners/chef/provisioner/chef_apply.rb b/plugins/provisioners/chef/provisioner/chef_apply.rb index 74f2033c0..ae69cfddd 100644 --- a/plugins/provisioners/chef/provisioner/chef_apply.rb +++ b/plugins/provisioners/chef/provisioner/chef_apply.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "digest/md5" -require "tempfile" +Vagrant.require "digest/md5" +Vagrant.require "tempfile" require_relative "base" diff --git a/plugins/provisioners/chef/provisioner/chef_client.rb b/plugins/provisioners/chef/provisioner/chef_client.rb index c6f939ad6..b917606a1 100644 --- a/plugins/provisioners/chef/provisioner/chef_client.rb +++ b/plugins/provisioners/chef/provisioner/chef_client.rb @@ -1,11 +1,11 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'pathname' +Vagrant.require 'pathname' -require 'vagrant' -require 'vagrant/util/presence' -require 'vagrant/util/subprocess' +Vagrant.require 'vagrant' +Vagrant.require 'vagrant/util/presence' +Vagrant.require 'vagrant/util/subprocess' require_relative "base" diff --git a/plugins/provisioners/chef/provisioner/chef_zero.rb b/plugins/provisioners/chef/provisioner/chef_zero.rb index a3a47057b..c2837dd78 100644 --- a/plugins/provisioners/chef/provisioner/chef_zero.rb +++ b/plugins/provisioners/chef/provisioner/chef_zero.rb @@ -1,13 +1,13 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "digest/md5" -require "securerandom" -require "set" +Vagrant.require "digest/md5" +Vagrant.require "securerandom" +Vagrant.require "set" -require "log4r" +Vagrant.require "log4r" -require "vagrant/util/counter" +Vagrant.require "vagrant/util/counter" require_relative "chef_solo" diff --git a/plugins/provisioners/container/client.rb b/plugins/provisioners/container/client.rb index d04f43a05..57fd2fabe 100644 --- a/plugins/provisioners/container/client.rb +++ b/plugins/provisioners/container/client.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'digest/sha1' +Vagrant.require 'digest/sha1' module VagrantPlugins module ContainerProvisioner diff --git a/plugins/provisioners/container/config.rb b/plugins/provisioners/container/config.rb index 9edc6fa63..f910b9202 100644 --- a/plugins/provisioners/container/config.rb +++ b/plugins/provisioners/container/config.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'set' +Vagrant.require 'set' module VagrantPlugins module ContainerProvisioner diff --git a/plugins/provisioners/file/config.rb b/plugins/provisioners/file/config.rb index 6dce6509e..0e8fe80b3 100644 --- a/plugins/provisioners/file/config.rb +++ b/plugins/provisioners/file/config.rb @@ -1,9 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" - -require "vagrant" +Vagrant.require "pathname" module VagrantPlugins module FileUpload diff --git a/plugins/provisioners/puppet/provisioner/puppet.rb b/plugins/provisioners/puppet/provisioner/puppet.rb index 26fe22347..39404ec35 100644 --- a/plugins/provisioners/puppet/provisioner/puppet.rb +++ b/plugins/provisioners/puppet/provisioner/puppet.rb @@ -1,9 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "digest/md5" - -require "log4r" +Vagrant.require "digest/md5" +Vagrant.require "log4r" module VagrantPlugins module Puppet diff --git a/plugins/provisioners/salt/bootstrap_downloader.rb b/plugins/provisioners/salt/bootstrap_downloader.rb index 8c0abd036..2b048f8e0 100644 --- a/plugins/provisioners/salt/bootstrap_downloader.rb +++ b/plugins/provisioners/salt/bootstrap_downloader.rb @@ -1,8 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'open-uri' -require 'digest' +Vagrant.require 'open-uri' +Vagrant.require 'digest' + require_relative "./errors" module VagrantPlugins diff --git a/plugins/provisioners/salt/provisioner.rb b/plugins/provisioners/salt/provisioner.rb index 1047e9456..a7d96dc8f 100644 --- a/plugins/provisioners/salt/provisioner.rb +++ b/plugins/provisioners/salt/provisioner.rb @@ -1,7 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'json' +Vagrant.require 'json' + require_relative "bootstrap_downloader" module VagrantPlugins diff --git a/plugins/provisioners/shell/config.rb b/plugins/provisioners/shell/config.rb index ce10c6bf9..8a1e2013d 100644 --- a/plugins/provisioners/shell/config.rb +++ b/plugins/provisioners/shell/config.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'uri' +Vagrant.require 'uri' module VagrantPlugins module Shell diff --git a/plugins/provisioners/shell/provisioner.rb b/plugins/provisioners/shell/provisioner.rb index e1cf59149..fc320b49a 100644 --- a/plugins/provisioners/shell/provisioner.rb +++ b/plugins/provisioners/shell/provisioner.rb @@ -1,12 +1,12 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" -require "tempfile" +Vagrant.require "pathname" +Vagrant.require "tempfile" -require "vagrant/util/downloader" -require "vagrant/util/line_buffer" -require "vagrant/util/retryable" +Vagrant.require "vagrant/util/downloader" +Vagrant.require "vagrant/util/line_buffer" +Vagrant.require "vagrant/util/retryable" module VagrantPlugins module Shell diff --git a/plugins/pushes/ftp/adapter.rb b/plugins/pushes/ftp/adapter.rb index 535d44625..208511374 100644 --- a/plugins/pushes/ftp/adapter.rb +++ b/plugins/pushes/ftp/adapter.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "pathname" +Vagrant.require "pathname" module VagrantPlugins module FTPPush @@ -50,7 +50,7 @@ module VagrantPlugins # class FTPAdapter < Adapter def initialize(*) - require "net/ftp" + Vagrant.require "net/ftp" super end @@ -107,7 +107,7 @@ module VagrantPlugins # class SFTPAdapter < Adapter def initialize(*) - require "net/sftp" + Vagrant.require "net/sftp" super @dirs = {} end diff --git a/plugins/pushes/ftp/push.rb b/plugins/pushes/ftp/push.rb index 9c85a001d..5717c9849 100644 --- a/plugins/pushes/ftp/push.rb +++ b/plugins/pushes/ftp/push.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "net/ftp" -require "pathname" +Vagrant.require "net/ftp" +Vagrant.require "pathname" require_relative "adapter" require_relative "errors" diff --git a/plugins/pushes/local-exec/push.rb b/plugins/pushes/local-exec/push.rb index 429f6a226..43ff353bb 100644 --- a/plugins/pushes/local-exec/push.rb +++ b/plugins/pushes/local-exec/push.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" -require "tempfile" -require "vagrant/util/safe_exec" +Vagrant.require "fileutils" +Vagrant.require "tempfile" +Vagrant.require "vagrant/util/safe_exec" require_relative "errors" diff --git a/plugins/synced_folders/nfs/action_cleanup.rb b/plugins/synced_folders/nfs/action_cleanup.rb index eadf865da..b3f526310 100644 --- a/plugins/synced_folders/nfs/action_cleanup.rb +++ b/plugins/synced_folders/nfs/action_cleanup.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" module VagrantPlugins module SyncedFolderNFS diff --git a/plugins/synced_folders/nfs/synced_folder.rb b/plugins/synced_folders/nfs/synced_folder.rb index 44efcf37a..4bb8e27da 100644 --- a/plugins/synced_folders/nfs/synced_folder.rb +++ b/plugins/synced_folders/nfs/synced_folder.rb @@ -1,13 +1,13 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'fileutils' -require 'thread' -require 'zlib' +Vagrant.require 'fileutils' +Vagrant.require 'thread' +Vagrant.require 'zlib' -require "log4r" +Vagrant.require "log4r" -require "vagrant/util/platform" +Vagrant.require "vagrant/util/platform" module VagrantPlugins module SyncedFolderNFS diff --git a/plugins/synced_folders/rsync/command/rsync.rb b/plugins/synced_folders/rsync/command/rsync.rb index 8268b32d2..a02c2ace7 100644 --- a/plugins/synced_folders/rsync/command/rsync.rb +++ b/plugins/synced_folders/rsync/command/rsync.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require 'optparse' +Vagrant.require 'optparse' -require "vagrant/action/builtin/mixin_synced_folders" +Vagrant.require "vagrant/action/builtin/mixin_synced_folders" require_relative "../helper" diff --git a/plugins/synced_folders/rsync/command/rsync_auto.rb b/plugins/synced_folders/rsync/command/rsync_auto.rb index b269ddb97..bcc093251 100644 --- a/plugins/synced_folders/rsync/command/rsync_auto.rb +++ b/plugins/synced_folders/rsync/command/rsync_auto.rb @@ -1,17 +1,17 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" -require 'optparse' -require "thread" +Vagrant.require "log4r" +Vagrant.require 'optparse' +Vagrant.require "thread" -require "vagrant/action/builtin/mixin_synced_folders" -require "vagrant/util/busy" -require "vagrant/util/platform" +Vagrant.require "vagrant/action/builtin/mixin_synced_folders" +Vagrant.require "vagrant/util/busy" +Vagrant.require "vagrant/util/platform" require_relative "../helper" -require "listen" +Vagrant.require "listen" module VagrantPlugins module SyncedFolderRSync diff --git a/plugins/synced_folders/rsync/default_unix_cap.rb b/plugins/synced_folders/rsync/default_unix_cap.rb index f39244a33..91371ff79 100644 --- a/plugins/synced_folders/rsync/default_unix_cap.rb +++ b/plugins/synced_folders/rsync/default_unix_cap.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "shellwords" +Vagrant.require "shellwords" module VagrantPlugins module SyncedFolderRSync diff --git a/plugins/synced_folders/rsync/helper.rb b/plugins/synced_folders/rsync/helper.rb index d6c2180eb..91c94b7b8 100644 --- a/plugins/synced_folders/rsync/helper.rb +++ b/plugins/synced_folders/rsync/helper.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "fileutils" -require "ipaddr" -require "shellwords" -require "tmpdir" +Vagrant.require "fileutils" +Vagrant.require "ipaddr" +Vagrant.require "shellwords" +Vagrant.require "tmpdir" require "vagrant/util/platform" require "vagrant/util/subprocess" diff --git a/plugins/synced_folders/rsync/synced_folder.rb b/plugins/synced_folders/rsync/synced_folder.rb index caef81e60..28971a9fc 100644 --- a/plugins/synced_folders/rsync/synced_folder.rb +++ b/plugins/synced_folders/rsync/synced_folder.rb @@ -1,10 +1,10 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "log4r" +Vagrant.require "log4r" -require "vagrant/util/subprocess" -require "vagrant/util/which" +Vagrant.require "vagrant/util/subprocess" +Vagrant.require "vagrant/util/which" require_relative "helper" diff --git a/plugins/synced_folders/smb/synced_folder.rb b/plugins/synced_folders/smb/synced_folder.rb index 4b18e8252..53292c887 100644 --- a/plugins/synced_folders/smb/synced_folder.rb +++ b/plugins/synced_folders/smb/synced_folder.rb @@ -1,13 +1,13 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "digest/md5" -require "json" +Vagrant.require "digest/md5" +Vagrant.require "json" -require "log4r" +Vagrant.require "log4r" -require "vagrant/util/platform" -require "vagrant/util/powershell" +Vagrant.require "vagrant/util/platform" +Vagrant.require "vagrant/util/powershell" require_relative "errors" diff --git a/plugins/synced_folders/unix_mount_helpers.rb b/plugins/synced_folders/unix_mount_helpers.rb index 88269ec4a..3462f1274 100644 --- a/plugins/synced_folders/unix_mount_helpers.rb +++ b/plugins/synced_folders/unix_mount_helpers.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -require "shellwords" -require "vagrant/util/retryable" +Vagrant.require "shellwords" +Vagrant.require "vagrant/util/retryable" module VagrantPlugins module SyncedFolder diff --git a/test/unit/plugins/guests/linux/cap/mount_smb_shared_folder_test.rb b/test/unit/plugins/guests/linux/cap/mount_smb_shared_folder_test.rb index 467cb8638..1c5e03a39 100644 --- a/test/unit/plugins/guests/linux/cap/mount_smb_shared_folder_test.rb +++ b/test/unit/plugins/guests/linux/cap/mount_smb_shared_folder_test.rb @@ -59,6 +59,7 @@ describe "VagrantPlugins::GuestLinux::Cap::MountSMBSharedFolder" do allow(comm).to receive(:execute).with(any_args) allow(machine).to receive(:guest).and_return(guest) allow(guest).to receive(:capability).with(:shell_expand_guest_path, mount_guest_path).and_return(mount_guest_path) + allow(ENV).to receive(:[]).and_call_original allow(ENV).to receive(:[]).with("VAGRANT_DISABLE_SMBMFSYMLINKS").and_return(false) allow(ENV).to receive(:[]).with("GEM_SKIP").and_return(false) allow(cap).to receive(:display_mfsymlinks_warning)