From ea25996b21e9ed224822695383ea8ffa1a6175da Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 2 Apr 2025 10:46:31 -0700 Subject: [PATCH] Update Vagrant behavior outside of installers Remove customized require behaviors and modify the bin executable to check for missing tools that Vagrant expects to exist when running outside of an installer. --- bin/vagrant | 20 +- lib/vagrant.rb | 50 ++-- lib/vagrant/action.rb | 2 +- lib/vagrant/action/builtin/box_add.rb | 18 +- .../action/builtin/box_check_outdated.rb | 2 +- lib/vagrant/action/builtin/box_remove.rb | 2 +- lib/vagrant/action/builtin/box_update.rb | 2 +- lib/vagrant/action/builtin/cleanup_disks.rb | 112 ++++---- .../action/builtin/cloud_init_setup.rb | 244 +++++++++--------- lib/vagrant/action/builtin/cloud_init_wait.rb | 2 +- lib/vagrant/action/builtin/config_validate.rb | 2 +- lib/vagrant/action/builtin/disk.rb | 104 ++++---- lib/vagrant/action/builtin/graceful_halt.rb | 4 +- lib/vagrant/action/builtin/handle_box.rb | 4 +- .../handle_forwarded_port_collisions.rb | 10 +- lib/vagrant/action/builtin/lock.rb | 2 +- .../action/builtin/mixin_synced_folders.rb | 6 +- lib/vagrant/action/builtin/prepare_clone.rb | 2 +- lib/vagrant/action/builtin/provision.rb | 2 +- .../action/builtin/provisioner_cleanup.rb | 2 +- lib/vagrant/action/builtin/set_hostname.rb | 2 +- lib/vagrant/action/builtin/ssh_exec.rb | 4 +- lib/vagrant/action/builtin/ssh_run.rb | 8 +- .../action/builtin/synced_folder_cleanup.rb | 2 +- lib/vagrant/action/builtin/synced_folders.rb | 4 +- lib/vagrant/action/general/package.rb | 10 +- .../action/general/package_setup_folders.rb | 2 +- lib/vagrant/action/runner.rb | 8 +- lib/vagrant/action/warden.rb | 4 +- lib/vagrant/alias.rb | 2 +- lib/vagrant/batch_action.rb | 4 +- lib/vagrant/box.rb | 18 +- lib/vagrant/box_collection.rb | 14 +- lib/vagrant/box_metadata.rb | 2 +- lib/vagrant/bundler.rb | 18 +- lib/vagrant/cli.rb | 6 +- lib/vagrant/config.rb | 2 +- lib/vagrant/config/v1/loader.rb | 2 +- lib/vagrant/config/v1/root.rb | 2 +- lib/vagrant/config/v2/loader.rb | 2 +- lib/vagrant/config/v2/root.rb | 4 +- lib/vagrant/environment.rb | 24 +- lib/vagrant/guest.rb | 4 +- lib/vagrant/host.rb | 2 +- lib/vagrant/machine.rb | 6 +- lib/vagrant/machine_index.rb | 10 +- lib/vagrant/patches/fake_ftp.rb | 2 +- lib/vagrant/patches/log4r.rb | 2 +- lib/vagrant/patches/net-ssh.rb | 4 +- lib/vagrant/plugin/manager.rb | 4 +- lib/vagrant/plugin/state_file.rb | 6 +- lib/vagrant/plugin/v1.rb | 4 +- lib/vagrant/plugin/v1/command.rb | 4 +- lib/vagrant/plugin/v1/manager.rb | 2 +- lib/vagrant/plugin/v1/plugin.rb | 4 +- lib/vagrant/plugin/v2.rb | 6 +- lib/vagrant/plugin/v2/command.rb | 4 +- lib/vagrant/plugin/v2/communicator.rb | 2 +- lib/vagrant/plugin/v2/config.rb | 2 +- lib/vagrant/plugin/v2/manager.rb | 2 +- lib/vagrant/plugin/v2/plugin.rb | 6 +- lib/vagrant/plugin/v2/provider.rb | 2 +- lib/vagrant/plugin/v2/trigger.rb | 14 +- lib/vagrant/shared_helpers.rb | 70 +---- lib/vagrant/ui.rb | 12 +- lib/vagrant/util/caps.rb | 10 +- lib/vagrant/util/checkpoint_client.rb | 4 +- lib/vagrant/util/counter.rb | 2 +- lib/vagrant/util/directory.rb | 2 +- lib/vagrant/util/downloader.rb | 22 +- lib/vagrant/util/file_checksum.rb | 2 +- lib/vagrant/util/io.rb | 2 +- lib/vagrant/util/is_port_open.rb | 2 +- lib/vagrant/util/keypair.rb | 8 +- lib/vagrant/util/logging_formatter.rb | 4 +- lib/vagrant/util/mime.rb | 4 +- lib/vagrant/util/network_ip.rb | 2 +- lib/vagrant/util/platform.rb | 16 +- lib/vagrant/util/powershell.rb | 4 +- lib/vagrant/util/retryable.rb | 2 +- lib/vagrant/util/safe_chdir.rb | 2 +- lib/vagrant/util/ssh.rb | 16 +- lib/vagrant/util/subprocess.rb | 14 +- lib/vagrant/util/template_renderer.rb | 6 +- lib/vagrant/util/uploader.rb | 12 +- lib/vagrant/util/which.rb | 2 +- lib/vagrant/util/windows_path.rb | 2 +- lib/vagrant/vagrantfile.rb | 4 +- .../commands/autocomplete/command/install.rb | 2 +- plugins/commands/autocomplete/command/root.rb | 2 +- plugins/commands/box/command/add.rb | 2 +- plugins/commands/box/command/list.rb | 2 +- plugins/commands/box/command/outdated.rb | 2 +- plugins/commands/box/command/prune.rb | 2 +- plugins/commands/box/command/remove.rb | 2 +- plugins/commands/box/command/repackage.rb | 6 +- plugins/commands/box/command/root.rb | 2 +- plugins/commands/box/command/update.rb | 2 +- plugins/commands/cap/command.rb | 2 +- plugins/commands/cloud/auth/login.rb | 2 +- plugins/commands/cloud/auth/logout.rb | 2 +- .../auth/middleware/add_authentication.rb | 6 +- .../add_downloader_authentication.rb | 6 +- plugins/commands/cloud/auth/whoami.rb | 2 +- plugins/commands/cloud/box/create.rb | 2 +- plugins/commands/cloud/box/delete.rb | 2 +- plugins/commands/cloud/box/show.rb | 2 +- plugins/commands/cloud/box/update.rb | 2 +- plugins/commands/cloud/client/client.rb | 6 +- plugins/commands/cloud/list.rb | 2 +- plugins/commands/cloud/plugin.rb | 2 +- plugins/commands/cloud/provider/create.rb | 2 +- plugins/commands/cloud/provider/delete.rb | 2 +- plugins/commands/cloud/provider/update.rb | 2 +- plugins/commands/cloud/provider/upload.rb | 4 +- plugins/commands/cloud/publish.rb | 4 +- plugins/commands/cloud/search.rb | 2 +- plugins/commands/cloud/version/release.rb | 2 +- plugins/commands/cloud/version/revoke.rb | 2 +- plugins/commands/cloud/version/update.rb | 2 +- plugins/commands/global-status/command.rb | 2 +- plugins/commands/halt/command.rb | 2 +- plugins/commands/help/command.rb | 2 +- plugins/commands/init/command.rb | 2 +- plugins/commands/list-commands/command.rb | 2 +- plugins/commands/package/command.rb | 4 +- plugins/commands/plugin/action.rb | 4 +- .../commands/plugin/action/expunge_plugins.rb | 2 +- plugins/commands/plugin/action/install_gem.rb | 6 +- .../commands/plugin/action/license_plugin.rb | 10 +- .../commands/plugin/action/list_plugins.rb | 2 +- .../plugin/action/plugin_exists_check.rb | 2 +- .../commands/plugin/action/repair_plugins.rb | 2 +- plugins/commands/plugin/action/update_gems.rb | 2 +- plugins/commands/plugin/command/base.rb | 2 +- plugins/commands/plugin/command/expunge.rb | 2 +- plugins/commands/plugin/command/install.rb | 2 +- plugins/commands/plugin/command/license.rb | 2 +- plugins/commands/plugin/command/list.rb | 2 +- plugins/commands/plugin/command/repair.rb | 2 +- plugins/commands/plugin/command/root.rb | 2 +- plugins/commands/plugin/command/uninstall.rb | 2 +- plugins/commands/plugin/command/update.rb | 2 +- plugins/commands/plugin/gem_helper.rb | 8 +- plugins/commands/port/command.rb | 2 +- plugins/commands/powershell/command.rb | 2 +- plugins/commands/provider/command.rb | 2 +- plugins/commands/provision/command.rb | 2 +- plugins/commands/push/command.rb | 2 +- plugins/commands/rdp/command.rb | 2 +- plugins/commands/reload/command.rb | 2 +- plugins/commands/resume/command.rb | 2 +- plugins/commands/snapshot/command/delete.rb | 2 +- plugins/commands/snapshot/command/list.rb | 2 +- plugins/commands/snapshot/command/pop.rb | 4 +- plugins/commands/snapshot/command/push.rb | 4 +- .../commands/snapshot/command/push_shared.rb | 2 +- plugins/commands/snapshot/command/restore.rb | 2 +- plugins/commands/snapshot/command/root.rb | 2 +- plugins/commands/snapshot/command/save.rb | 2 +- plugins/commands/ssh/command.rb | 2 +- plugins/commands/ssh_config/command.rb | 6 +- plugins/commands/status/command.rb | 2 +- plugins/commands/suspend/command.rb | 2 +- plugins/commands/up/command.rb | 4 +- plugins/commands/up/start_mixins.rb | 2 +- plugins/commands/upload/command.rb | 4 +- plugins/commands/validate/command.rb | 4 +- plugins/commands/version/command.rb | 2 +- plugins/commands/winrm/command.rb | 4 +- plugins/commands/winrm_config/command.rb | 2 +- plugins/communicators/ssh/communicator.rb | 30 +-- .../winrm/command_filters/mkdir.rb | 2 +- .../communicators/winrm/command_filters/rm.rb | 2 +- .../winrm/command_filters/test.rb | 2 +- .../winrm/command_filters/which.rb | 2 +- plugins/communicators/winrm/communicator.rb | 6 +- plugins/communicators/winrm/shell.rb | 14 +- plugins/communicators/winssh/communicator.rb | 2 +- .../guests/alpine/cap/configure_networks.rb | 8 +- plugins/guests/alt/cap/configure_networks.rb | 2 +- plugins/guests/arch/cap/configure_networks.rb | 6 +- plugins/guests/bsd/cap/nfs.rb | 4 +- plugins/guests/bsd/cap/public_key.rb | 4 +- plugins/guests/coreos/cap/change_host_name.rb | 4 +- .../guests/darwin/cap/configure_networks.rb | 4 +- .../darwin/cap/mount_smb_shared_folder.rb | 4 +- .../darwin/cap/mount_vmware_shared_folder.rb | 2 +- plugins/guests/debian/cap/change_host_name.rb | 6 +- .../guests/debian/cap/configure_networks.rb | 2 +- plugins/guests/esxi/cap/public_key.rb | 4 +- .../guests/freebsd/cap/configure_networks.rb | 2 +- .../guests/funtoo/cap/configure_networks.rb | 2 +- .../guests/gentoo/cap/configure_networks.rb | 4 +- .../linux/cap/mount_smb_shared_folder.rb | 4 +- plugins/guests/linux/cap/public_key.rb | 4 +- plugins/guests/linux/cap/reboot.rb | 4 +- .../guests/netbsd/cap/configure_networks.rb | 2 +- plugins/guests/nixos/cap/change_host_name.rb | 2 +- .../guests/nixos/cap/configure_networks.rb | 4 +- .../guests/openbsd/cap/configure_networks.rb | 2 +- .../guests/redhat/cap/configure_networks.rb | 4 +- .../slackware/cap/configure_networks.rb | 2 +- plugins/guests/suse/cap/configure_networks.rb | 2 +- .../guests/tinycore/cap/configure_networks.rb | 2 +- .../guests/windows/cap/change_host_name.rb | 2 +- .../guests/windows/cap/configure_networks.rb | 2 +- .../guests/windows/cap/mount_shared_folder.rb | 4 +- plugins/guests/windows/cap/public_key.rb | 2 +- plugins/guests/windows/cap/reboot.rb | 2 +- plugins/guests/windows/guest_network.rb | 2 +- plugins/hosts/bsd/cap/nfs.rb | 8 +- .../darwin/cap/configured_ip_addresses.rb | 2 +- plugins/hosts/darwin/cap/fs_iso.rb | 4 +- .../darwin/cap/provider_install_virtualbox.rb | 10 +- plugins/hosts/darwin/cap/rdp.rb | 6 +- plugins/hosts/linux/cap/fs_iso.rb | 4 +- plugins/hosts/linux/cap/nfs.rb | 8 +- plugins/hosts/linux/cap/rdp.rb | 112 ++++---- plugins/hosts/redhat/cap/nfs.rb | 2 +- plugins/hosts/redhat/host.rb | 2 +- plugins/hosts/suse/host.rb | 2 +- plugins/hosts/void/host.rb | 2 +- .../windows/cap/configured_ip_addresses.rb | 12 +- plugins/hosts/windows/cap/fs_iso.rb | 4 +- .../cap/provider_install_virtualbox.rb | 12 +- plugins/hosts/windows/cap/ps.rb | 6 +- plugins/hosts/windows/cap/rdp.rb | 6 +- plugins/kernel_v2/config/cloud_init.rb | 4 +- plugins/kernel_v2/config/disk.rb | 6 +- plugins/kernel_v2/config/vm.rb | 20 +- plugins/kernel_v2/config/vm_provisioner.rb | 2 +- plugins/kernel_v2/config/vm_trigger.rb | 4 +- plugins/providers/docker/action/build.rb | 4 +- .../docker/action/connect_networks.rb | 6 +- .../docker/action/destroy_build_image.rb | 2 +- .../docker/action/destroy_network.rb | 2 +- .../providers/docker/action/host_machine.rb | 2 +- .../docker/action/host_machine_build_dir.rb | 4 +- .../action/host_machine_sync_folders.rb | 8 +- .../host_machine_sync_folders_disable.rb | 4 +- plugins/providers/docker/action/login.rb | 2 +- .../docker/action/prepare_networks.rb | 6 +- .../docker/action/wait_for_running.rb | 4 +- plugins/providers/docker/communicator.rb | 4 +- plugins/providers/docker/config.rb | 2 +- plugins/providers/docker/driver.rb | 4 +- plugins/providers/docker/driver/compose.rb | 4 +- plugins/providers/docker/provider.rb | 10 +- .../providers/hyperv/action/check_enabled.rb | 4 +- plugins/providers/hyperv/action/configure.rb | 4 +- plugins/providers/hyperv/action/export.rb | 2 +- plugins/providers/hyperv/action/import.rb | 4 +- .../hyperv/action/package_metadata_json.rb | 2 +- .../hyperv/action/package_setup_folders.rb | 2 +- .../providers/hyperv/action/read_guest_ip.rb | 4 +- plugins/providers/hyperv/action/read_state.rb | 2 +- plugins/providers/hyperv/action/set_name.rb | 2 +- .../hyperv/action/wait_for_ip_address.rb | 4 +- plugins/providers/hyperv/cap/cleanup_disks.rb | 4 +- .../providers/hyperv/cap/configure_disks.rb | 8 +- .../providers/hyperv/cap/validate_disk_ext.rb | 2 +- plugins/providers/hyperv/driver.rb | 6 +- plugins/providers/hyperv/provider.rb | 2 +- .../action/check_guest_additions.rb | 2 +- .../virtualbox/action/clean_machine_folder.rb | 2 +- .../destroy_unused_network_interfaces.rb | 2 +- plugins/providers/virtualbox/action/export.rb | 4 +- .../virtualbox/action/import_master.rb | 4 +- .../providers/virtualbox/action/network.rb | 12 +- .../virtualbox/action/network_fix_ipv6.rb | 10 +- .../action/package_setup_folders.rb | 2 +- .../action/prepare_clone_snapshot.rb | 4 +- .../virtualbox/action/prepare_nfs_settings.rb | 4 +- .../virtualbox/action/sane_defaults.rb | 2 +- .../virtualbox/action/set_default_nic_type.rb | 2 +- .../providers/virtualbox/action/set_name.rb | 2 +- .../virtualbox/action/setup_package_files.rb | 2 +- .../providers/virtualbox/cap/cleanup_disks.rb | 4 +- .../virtualbox/cap/configure_disks.rb | 8 +- .../virtualbox/cap/validate_disk_ext.rb | 2 +- plugins/providers/virtualbox/driver/base.rb | 12 +- .../virtualbox/driver/version_4_1.rb | 4 +- .../virtualbox/driver/version_7_0.rb | 2 +- plugins/providers/virtualbox/provider.rb | 2 +- plugins/providers/virtualbox/synced_folder.rb | 4 +- .../provisioners/ansible/provisioner/guest.rb | 2 +- .../provisioners/ansible/provisioner/host.rb | 2 +- .../cap/linux/cfengine_needs_bootstrap.rb | 2 +- .../cfengine/cap/redhat/cfengine_install.rb | 2 +- plugins/provisioners/cfengine/config.rb | 2 +- plugins/provisioners/cfengine/provisioner.rb | 2 +- plugins/provisioners/chef/plugin.rb | 2 +- plugins/provisioners/chef/provisioner/base.rb | 2 +- .../chef/provisioner/chef_apply.rb | 4 +- .../chef/provisioner/chef_client.rb | 8 +- .../chef/provisioner/chef_zero.rb | 10 +- plugins/provisioners/container/client.rb | 2 +- plugins/provisioners/container/config.rb | 2 +- plugins/provisioners/file/config.rb | 2 +- .../provisioners/puppet/provisioner/puppet.rb | 4 +- .../provisioners/salt/bootstrap_downloader.rb | 4 +- plugins/provisioners/salt/provisioner.rb | 2 +- plugins/provisioners/shell/config.rb | 2 +- plugins/provisioners/shell/provisioner.rb | 10 +- plugins/pushes/ftp/adapter.rb | 6 +- plugins/pushes/ftp/push.rb | 4 +- plugins/pushes/local-exec/push.rb | 6 +- plugins/synced_folders/nfs/action_cleanup.rb | 2 +- plugins/synced_folders/nfs/synced_folder.rb | 10 +- plugins/synced_folders/rsync/command/rsync.rb | 4 +- .../rsync/command/rsync_auto.rb | 14 +- .../synced_folders/rsync/default_unix_cap.rb | 2 +- plugins/synced_folders/rsync/helper.rb | 8 +- plugins/synced_folders/rsync/synced_folder.rb | 6 +- plugins/synced_folders/smb/synced_folder.rb | 10 +- plugins/synced_folders/unix_mount_helpers.rb | 4 +- templates/locales/en.yml | 8 +- test/unit/bin/vagrant_test.rb | 10 +- 319 files changed, 1001 insertions(+), 1051 deletions(-) diff --git a/bin/vagrant b/bin/vagrant index 8cf698eb3..787e378dc 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -187,12 +187,6 @@ begin argv += argv_extra end - sub_cmd = Class.new(Vagrant.plugin("2", :command)) { - def sub_command - split_main_and_subcommand(@argv)[1] - end - }.new(argv.dup, nil).sub_command - # Create the environment, which is the cwd of wherever the # `vagrant` command was invoked from logger.debug("Creating Vagrant environment") @@ -209,9 +203,17 @@ begin end end - if !Vagrant.in_installer? && !Vagrant.very_quiet? - # If we're not in the installer, warn. - env.ui.warn(I18n.t("vagrant.general.not_in_installer") + "\n", prefix: false) + # If not being run from the installer, check if expected tools + # are available. + if !Vagrant.in_installer? + missing_tools = Vagrant.detect_missing_tools + + if !missing_tools.empty? + env.ui.warn( + I18n.t("vagrant.general.not_in_installer", tools: missing_tools.sort.join(", ")) + "\n", + prefix: false + ) + end end # Acceptable experimental flag values include: diff --git a/lib/vagrant.rb b/lib/vagrant.rb index 8611cb258..246b4013f 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -5,16 +5,16 @@ # require helper available. require "vagrant/shared_helpers" -Vagrant.require "log4r" +require "log4r" # Add patches to log4r to support trace level -Vagrant.require "vagrant/patches/log4r" -Vagrant.require "vagrant/patches/net-ssh" -Vagrant.require "vagrant/patches/rubygems" -Vagrant.require "vagrant/patches/timeout_error" +require "vagrant/patches/log4r" +require "vagrant/patches/net-ssh" +require "vagrant/patches/rubygems" +require "vagrant/patches/timeout_error" # Set our log levels and include trace -Vagrant.require 'log4r/configurator' +require 'log4r/configurator' Log4r::Configurator.custom_levels(*(["TRACE"] + Log4r::Log4rConfig::LogLevels)) # Update the default formatter within the log4r library to ensure @@ -26,7 +26,7 @@ class Log4r::BasicFormatter end end -Vagrant.require "optparse" +require "optparse" module Vagrant # This is a customized OptionParser for Vagrant plugins. It @@ -51,9 +51,9 @@ module VagrantPlugins end # Load in our helpers and utilities -Vagrant.require "rubygems" -Vagrant.require "vagrant/util" -Vagrant.require "vagrant/plugin/manager" +require "rubygems" +require "vagrant/util" +require "vagrant/plugin/manager" # Enable logging if it is requested. We do this before # anything else so that we can setup the output before @@ -110,19 +110,19 @@ if ENV["VAGRANT_LOG"] && ENV["VAGRANT_LOG"] != "" end end -Vagrant.require 'json' -Vagrant.require 'pathname' -Vagrant.require 'stringio' +require 'json' +require 'pathname' +require 'stringio' -Vagrant.require 'childprocess' -Vagrant.require 'i18n' +require 'childprocess' +require 'i18n' # OpenSSL must be loaded here since when it is loaded via `autoload` # there are issues with ciphers not being properly loaded. -Vagrant.require 'openssl' +require 'openssl' # Always make the version available -Vagrant.require 'vagrant/version' +require 'vagrant/version' global_logger = Log4r::Logger.new("vagrant::global") Vagrant.global_logger = global_logger global_logger.info("Vagrant version: #{Vagrant::VERSION}") @@ -143,7 +143,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 - Vagrant.require "vagrant/vagrant_ssl" + require "vagrant/vagrant_ssl" Vagrant.vagrant_ssl_load global_logger.debug("ssl providers successfully loaded") rescue LoadError => err @@ -157,8 +157,8 @@ end # We need these components always so instead of an autoload we # just require them explicitly here. -Vagrant.require "vagrant/plugin" -Vagrant.require "vagrant/registry" +require "vagrant/plugin" +require "vagrant/registry" module Vagrant autoload :Action, 'vagrant/action' @@ -235,7 +235,7 @@ module Vagrant end # Now check the plugin gem names - Vagrant.require "vagrant/plugin/manager" + require "vagrant/plugin/manager" Plugin::Manager.instance.plugin_installed?(name, version) end @@ -273,7 +273,7 @@ module Vagrant # @deprecated def self.require_plugin(name) - puts "Vagrant.require_plugin is deprecated and has no effect any longer." + puts "require_plugin is deprecated and has no effect any longer." puts "Use `vagrant plugin` commands to manage plugins. This warning will" puts "be removed in the next version of Vagrant." end @@ -297,9 +297,9 @@ module Vagrant # # Examples are shown below: # - # Vagrant.require_version(">= 1.3.5") - # Vagrant.require_version(">= 1.3.5", "< 1.4.0") - # Vagrant.require_version("~> 1.3.5") + # require_version(">= 1.3.5") + # require_version(">= 1.3.5", "< 1.4.0") + # require_version("~> 1.3.5") # def self.require_version(*requirements) logger = Log4r::Logger.new("vagrant::root") diff --git a/lib/vagrant/action.rb b/lib/vagrant/action.rb index 24ca57573..f90c63b0c 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 -Vagrant.require 'vagrant/action/builder' +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 38a756b4f..f04b8b861 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 -Vagrant.require "digest/sha1" -Vagrant.require "log4r" -Vagrant.require "pathname" -Vagrant.require "uri" +require "digest/sha1" +require "log4r" +require "pathname" +require "uri" -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" +require "vagrant/box_metadata" +require "vagrant/util/downloader" +require "vagrant/util/file_checksum" +require "vagrant/util/file_mutex" +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 809113952..25f1b9ff4 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 -Vagrant.require "log4r" +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 55ffaaccb..f10328407 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 -Vagrant.require "log4r" +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 371b57487..8f675669a 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 -Vagrant.require "log4r" +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 272ada2db..8f9c0703d 100644 --- a/lib/vagrant/action/builtin/cleanup_disks.rb +++ b/lib/vagrant/action/builtin/cleanup_disks.rb @@ -1,59 +1,59 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "json" - -module Vagrant - module Action - module Builtin - class CleanupDisks - # Removes any attached disks no longer defined in a Vagrantfile config - def initialize(app, env) - @app = app - @logger = Log4r::Logger.new("vagrant::action::builtin::disk") - end - - def call(env) - machine = env[:machine] - defined_disks = get_disks(machine, env) - - # Call into providers machine implementation for disk management - disk_meta_file = read_disk_metadata(machine) - - if !disk_meta_file.empty? - if machine.provider.capability?(:cleanup_disks) - machine.provider.capability(:cleanup_disks, defined_disks, disk_meta_file) - else - env[:ui].warn(I18n.t("vagrant.actions.disk.provider_unsupported", - provider: machine.provider_name)) - end - end - - # Continue On - @app.call(env) - end - - def read_disk_metadata(machine) - meta_file = machine.data_dir.join("disk_meta") - if File.file?(meta_file) - disk_meta = JSON.parse(meta_file.read) - else - @logger.info("No previous disk_meta file defined for guest #{machine.name}") - disk_meta = {} - end - - return disk_meta - end - - def get_disks(machine, env) - return @_disks if @_disks - - @_disks = [] - @_disks = machine.config.vm.disks - - @_disks - end - end - end - end -end +require "json" + +module Vagrant + module Action + module Builtin + class CleanupDisks + # Removes any attached disks no longer defined in a Vagrantfile config + def initialize(app, env) + @app = app + @logger = Log4r::Logger.new("vagrant::action::builtin::disk") + end + + def call(env) + machine = env[:machine] + defined_disks = get_disks(machine, env) + + # Call into providers machine implementation for disk management + disk_meta_file = read_disk_metadata(machine) + + if !disk_meta_file.empty? + if machine.provider.capability?(:cleanup_disks) + machine.provider.capability(:cleanup_disks, defined_disks, disk_meta_file) + else + env[:ui].warn(I18n.t("vagrant.actions.disk.provider_unsupported", + provider: machine.provider_name)) + end + end + + # Continue On + @app.call(env) + end + + def read_disk_metadata(machine) + meta_file = machine.data_dir.join("disk_meta") + if File.file?(meta_file) + disk_meta = JSON.parse(meta_file.read) + else + @logger.info("No previous disk_meta file defined for guest #{machine.name}") + disk_meta = {} + end + + return disk_meta + end + + def get_disks(machine, env) + return @_disks if @_disks + + @_disks = [] + @_disks = machine.config.vm.disks + + @_disks + end + end + end + end +end diff --git a/lib/vagrant/action/builtin/cloud_init_setup.rb b/lib/vagrant/action/builtin/cloud_init_setup.rb index 8e05aa73d..6cf512c01 100644 --- a/lib/vagrant/action/builtin/cloud_init_setup.rb +++ b/lib/vagrant/action/builtin/cloud_init_setup.rb @@ -1,125 +1,125 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'vagrant/util/mime' -Vagrant.require 'tmpdir' - -module Vagrant - module Action - module Builtin - class CloudInitSetup - TEMP_PREFIX = "vagrant-cloud-init-iso-temp-".freeze - - def initialize(app, env) - @app = app - @logger = Log4r::Logger.new("vagrant::action::builtin::cloudinit::setup") - end - - def call(env) - machine = env[:machine] - - user_data_configs = machine.config.vm.cloud_init_configs - .select { |c| c.type == :user_data } - - if !user_data_configs.empty? - user_data = setup_user_data(machine, env, user_data_configs) - meta_data = { "instance-id" => "i-#{machine.id.split('-').join}" } - - write_cfg_iso(machine, env, user_data, meta_data) - end - - # Continue On - @app.call(env) - end - - # @param [Vagrant::Machine] machine - # @param [Vagrant::Environment] env - # @param [Array<#VagrantPlugins::Kernel_V2::VagrantConfigCloudInit>] user_data_cfgs - # @return [Vagrant::Util::Mime::MultiPart] user_data - def setup_user_data(machine, env, user_data_cfgs) - machine.ui.info(I18n.t("vagrant.actions.vm.cloud_init_user_data_setup")) - - text_cfgs = user_data_cfgs.map { |cfg| read_text_cfg(machine, cfg) } - - user_data = generate_cfg_msg(machine, text_cfgs) - user_data - end - - # Reads an individual cloud_init config and stores its contents and the - # content_type as a MIME text - # - # @param [Vagrant::Machine] machine - # @param [VagrantPlugins::Kernel_V2::VagrantConfigCloudInit] cfg - # @return [Vagrant::Util::Mime::Entity] text_msg - def read_text_cfg(machine, cfg) - if cfg.path - text = File.read(Pathname.new(cfg.path).expand_path(machine.env.root_path)) - else - text = cfg.inline - end - - text_msg = Vagrant::Util::Mime::Entity.new(text, cfg.content_type) - text_msg.disposition = "attachment; filename=\"#{File.basename(cfg.content_disposition_filename).gsub('"', '\"')}\"" if cfg.content_disposition_filename - text_msg - end - - # Combines all known cloud_init configs into a multipart mixed MIME text - # message - # - # @param [Vagrant::Machine] machine - # @param [Array] text_msg - One or more text configs - # @return [Vagrant::Util::Mime::Multipart] msg - def generate_cfg_msg(machine, text_cfgs) - msg = Vagrant::Util::Mime::Multipart.new - msg.headers["MIME-Version"] = "1.0" - - text_cfgs.each do |c| - msg.add(c) - end - - msg - end - - # Writes the contents of the guests cloud_init config to a tmp - # dir and passes that source directory along to the host cap to be - # written to an iso - # - # @param [Vagrant::Machine] machine - # @param [Vagrant::Util::Mime::Multipart] user_data - # @param [Hash] meta_data - def write_cfg_iso(machine, env, user_data, meta_data) - iso_path = nil - - if env[:env].host.capability?(:create_iso) - begin - source_dir = Pathname.new(Dir.mktmpdir(TEMP_PREFIX)) - File.open("#{source_dir}/user-data", 'w') { |file| file.write(user_data.to_s) } - - File.open("#{source_dir}/meta-data", 'w') { |file| file.write(meta_data.to_yaml) } - - iso_path = env[:env].host.capability(:create_iso, - source_dir, volume_id: "cidata") - attach_disk_config(machine, env, iso_path.to_path) - ensure - FileUtils.remove_entry(source_dir) - end - else - raise Errors::CreateIsoHostCapNotFound - end - end - - # Adds a new :dvd disk config with the given iso_path to be attached - # to the guest later - # - # @param [Vagrant::Machine] machine - # @param [Vagrant::Environment] env - # @param [String] iso_path - def attach_disk_config(machine, env, iso_path) - @logger.info("Adding cloud_init iso '#{iso_path}' to disk config") - machine.config.vm.disk :dvd, file: iso_path, name: "vagrant-cloud_init-disk" - machine.config.vm.disks.each { |d| d.finalize! if d.type == :dvd && d.file == iso_path } - end - end - end - end -end +require 'vagrant/util/mime' +require 'tmpdir' + +module Vagrant + module Action + module Builtin + class CloudInitSetup + TEMP_PREFIX = "vagrant-cloud-init-iso-temp-".freeze + + def initialize(app, env) + @app = app + @logger = Log4r::Logger.new("vagrant::action::builtin::cloudinit::setup") + end + + def call(env) + machine = env[:machine] + + user_data_configs = machine.config.vm.cloud_init_configs + .select { |c| c.type == :user_data } + + if !user_data_configs.empty? + user_data = setup_user_data(machine, env, user_data_configs) + meta_data = { "instance-id" => "i-#{machine.id.split('-').join}" } + + write_cfg_iso(machine, env, user_data, meta_data) + end + + # Continue On + @app.call(env) + end + + # @param [Vagrant::Machine] machine + # @param [Vagrant::Environment] env + # @param [Array<#VagrantPlugins::Kernel_V2::VagrantConfigCloudInit>] user_data_cfgs + # @return [Vagrant::Util::Mime::MultiPart] user_data + def setup_user_data(machine, env, user_data_cfgs) + machine.ui.info(I18n.t("vagrant.actions.vm.cloud_init_user_data_setup")) + + text_cfgs = user_data_cfgs.map { |cfg| read_text_cfg(machine, cfg) } + + user_data = generate_cfg_msg(machine, text_cfgs) + user_data + end + + # Reads an individual cloud_init config and stores its contents and the + # content_type as a MIME text + # + # @param [Vagrant::Machine] machine + # @param [VagrantPlugins::Kernel_V2::VagrantConfigCloudInit] cfg + # @return [Vagrant::Util::Mime::Entity] text_msg + def read_text_cfg(machine, cfg) + if cfg.path + text = File.read(Pathname.new(cfg.path).expand_path(machine.env.root_path)) + else + text = cfg.inline + end + + text_msg = Vagrant::Util::Mime::Entity.new(text, cfg.content_type) + text_msg.disposition = "attachment; filename=\"#{File.basename(cfg.content_disposition_filename).gsub('"', '\"')}\"" if cfg.content_disposition_filename + text_msg + end + + # Combines all known cloud_init configs into a multipart mixed MIME text + # message + # + # @param [Vagrant::Machine] machine + # @param [Array] text_msg - One or more text configs + # @return [Vagrant::Util::Mime::Multipart] msg + def generate_cfg_msg(machine, text_cfgs) + msg = Vagrant::Util::Mime::Multipart.new + msg.headers["MIME-Version"] = "1.0" + + text_cfgs.each do |c| + msg.add(c) + end + + msg + end + + # Writes the contents of the guests cloud_init config to a tmp + # dir and passes that source directory along to the host cap to be + # written to an iso + # + # @param [Vagrant::Machine] machine + # @param [Vagrant::Util::Mime::Multipart] user_data + # @param [Hash] meta_data + def write_cfg_iso(machine, env, user_data, meta_data) + iso_path = nil + + if env[:env].host.capability?(:create_iso) + begin + source_dir = Pathname.new(Dir.mktmpdir(TEMP_PREFIX)) + File.open("#{source_dir}/user-data", 'w') { |file| file.write(user_data.to_s) } + + File.open("#{source_dir}/meta-data", 'w') { |file| file.write(meta_data.to_yaml) } + + iso_path = env[:env].host.capability(:create_iso, + source_dir, volume_id: "cidata") + attach_disk_config(machine, env, iso_path.to_path) + ensure + FileUtils.remove_entry(source_dir) + end + else + raise Errors::CreateIsoHostCapNotFound + end + end + + # Adds a new :dvd disk config with the given iso_path to be attached + # to the guest later + # + # @param [Vagrant::Machine] machine + # @param [Vagrant::Environment] env + # @param [String] iso_path + def attach_disk_config(machine, env, iso_path) + @logger.info("Adding cloud_init iso '#{iso_path}' to disk config") + machine.config.vm.disk :dvd, file: iso_path, name: "vagrant-cloud_init-disk" + machine.config.vm.disks.each { |d| d.finalize! if d.type == :dvd && d.file == iso_path } + end + end + end + end +end diff --git a/lib/vagrant/action/builtin/cloud_init_wait.rb b/lib/vagrant/action/builtin/cloud_init_wait.rb index 5d3c46501..032af5057 100644 --- a/lib/vagrant/action/builtin/cloud_init_wait.rb +++ b/lib/vagrant/action/builtin/cloud_init_wait.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "log4r" +require "log4r" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/config_validate.rb b/lib/vagrant/action/builtin/config_validate.rb index 484b62580..ad315830a 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 -Vagrant.require "vagrant/util/template_renderer" +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 ce9d3b723..6b6f2420e 100644 --- a/lib/vagrant/action/builtin/disk.rb +++ b/lib/vagrant/action/builtin/disk.rb @@ -1,55 +1,55 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "json" - -module Vagrant - module Action - module Builtin - class Disk - def initialize(app, env) - @app = app - @logger = Log4r::Logger.new("vagrant::action::builtin::disk") - end - - def call(env) - machine = env[:machine] - defined_disks = get_disks(machine, env) - - # Call into providers machine implementation for disk management - configured_disks = {} - if !defined_disks.empty? - if machine.provider.capability?(:configure_disks) - configured_disks = machine.provider.capability(:configure_disks, defined_disks) - else - env[:ui].warn(I18n.t("vagrant.actions.disk.provider_unsupported", - provider: machine.provider_name)) - end - end - - write_disk_metadata(machine, configured_disks) unless configured_disks.empty? - - # Continue On - @app.call(env) - end - - def write_disk_metadata(machine, current_disks) - meta_file = machine.data_dir.join("disk_meta") - @logger.debug("Writing disk metadata file to #{meta_file}") - File.open(meta_file.to_s, "w+") do |file| - file.write(JSON.dump(current_disks)) - end - end - - def get_disks(machine, env) - return @_disks if @_disks - - @_disks = [] - @_disks = machine.config.vm.disks - - @_disks - end - end - end - end -end +require "json" + +module Vagrant + module Action + module Builtin + class Disk + def initialize(app, env) + @app = app + @logger = Log4r::Logger.new("vagrant::action::builtin::disk") + end + + def call(env) + machine = env[:machine] + defined_disks = get_disks(machine, env) + + # Call into providers machine implementation for disk management + configured_disks = {} + if !defined_disks.empty? + if machine.provider.capability?(:configure_disks) + configured_disks = machine.provider.capability(:configure_disks, defined_disks) + else + env[:ui].warn(I18n.t("vagrant.actions.disk.provider_unsupported", + provider: machine.provider_name)) + end + end + + write_disk_metadata(machine, configured_disks) unless configured_disks.empty? + + # Continue On + @app.call(env) + end + + def write_disk_metadata(machine, current_disks) + meta_file = machine.data_dir.join("disk_meta") + @logger.debug("Writing disk metadata file to #{meta_file}") + File.open(meta_file.to_s, "w+") do |file| + file.write(JSON.dump(current_disks)) + end + end + + def get_disks(machine, env) + return @_disks if @_disks + + @_disks = [] + @_disks = machine.config.vm.disks + + @_disks + end + end + end + end +end diff --git a/lib/vagrant/action/builtin/graceful_halt.rb b/lib/vagrant/action/builtin/graceful_halt.rb index 02119237c..34b8268be 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 -Vagrant.require "log4r" -Vagrant.require "timeout" +require "log4r" +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 5166f3042..c4e2130f4 100644 --- a/lib/vagrant/action/builtin/handle_box.rb +++ b/lib/vagrant/action/builtin/handle_box.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "thread" -Vagrant.require "log4r" +require "thread" +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 c9fa92b72..751bd671a 100644 --- a/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb +++ b/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb @@ -1,12 +1,12 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "set" -Vagrant.require "log4r" -Vagrant.require "socket" +require "set" +require "log4r" +require "socket" -Vagrant.require "vagrant/util/is_port_open" -Vagrant.require "vagrant/util/ipv4_interfaces" +require "vagrant/util/is_port_open" +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 fdba1223c..8df79c812 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 -Vagrant.require "log4r" +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 2361e8047..aaa03f9da 100644 --- a/lib/vagrant/action/builtin/mixin_synced_folders.rb +++ b/lib/vagrant/action/builtin/mixin_synced_folders.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "json" -Vagrant.require "set" -Vagrant.require 'vagrant/util/scoped_hash_override' +require "json" +require "set" +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 bca583480..51fb36b30 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 -Vagrant.require "log4r" +require "log4r" module Vagrant module Action diff --git a/lib/vagrant/action/builtin/provision.rb b/lib/vagrant/action/builtin/provision.rb index 591539138..776f6c7dc 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 -Vagrant.require "log4r" +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 2975fac6e..573734b74 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 -Vagrant.require "log4r" +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 d659c104d..b1fe4c38b 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 -Vagrant.require "log4r" +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 0cba24485..caa4cd45b 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 -Vagrant.require "pathname" +require "pathname" -Vagrant.require "vagrant/util/ssh" +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 9f9466435..7123d23f0 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 -Vagrant.require "log4r" +require "log4r" -Vagrant.require "vagrant/util/platform" -Vagrant.require "vagrant/util/ssh" -Vagrant.require "vagrant/util/shell_quote" +require "vagrant/util/platform" +require "vagrant/util/ssh" +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 b5b46f3bd..22aab95fd 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 -Vagrant.require "log4r" +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 5d9c7f223..be11dce98 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 -Vagrant.require "log4r" +require "log4r" -Vagrant.require 'vagrant/util/platform' +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 0dd734289..e465b62a6 100644 --- a/lib/vagrant/action/general/package.rb +++ b/lib/vagrant/action/general/package.rb @@ -1,11 +1,11 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'fileutils' -Vagrant.require "pathname" -Vagrant.require 'vagrant/util/safe_chdir' -Vagrant.require 'vagrant/util/subprocess' -Vagrant.require 'vagrant/util/presence' +require 'fileutils' +require "pathname" +require 'vagrant/util/safe_chdir' +require 'vagrant/util/subprocess' +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 32084b3ee..f31b6d74a 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 -Vagrant.require "fileutils" +require "fileutils" require_relative "package" module Vagrant diff --git a/lib/vagrant/action/runner.rb b/lib/vagrant/action/runner.rb index a26c531e3..67f5aa8c8 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 -Vagrant.require 'log4r' +require 'log4r' -Vagrant.require 'vagrant/action/hook' -Vagrant.require 'vagrant/util/busy' -Vagrant.require 'vagrant/util/experimental' +require 'vagrant/action/hook' +require 'vagrant/util/busy' +require 'vagrant/util/experimental' module Vagrant module Action diff --git a/lib/vagrant/action/warden.rb b/lib/vagrant/action/warden.rb index 0e04b311f..33a271479 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 -Vagrant.require "log4r" -Vagrant.require 'vagrant/util/experimental' +require "log4r" +require 'vagrant/util/experimental' module Vagrant module Action diff --git a/lib/vagrant/alias.rb b/lib/vagrant/alias.rb index 50fa52e7e..deff23699 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 -Vagrant.require "vagrant/registry" +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 21ca77189..a73272890 100644 --- a/lib/vagrant/batch_action.rb +++ b/lib/vagrant/batch_action.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'thread' -Vagrant.require "log4r" +require 'thread' +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 714d1781e..404c52b67 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 -Vagrant.require 'fileutils' -Vagrant.require "tempfile" +require 'fileutils' +require "tempfile" -Vagrant.require "json" -Vagrant.require "log4r" +require "json" +require "log4r" -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" +require "vagrant/box_metadata" +require "vagrant/util/downloader" +require "vagrant/util/platform" +require "vagrant/util/safe_chdir" +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 ffeee258e..4cb7e4072 100644 --- a/lib/vagrant/box_collection.rb +++ b/lib/vagrant/box_collection.rb @@ -1,13 +1,13 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -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" +require "digest/sha1" +require "fileutils" +require "monitor" +require "tmpdir" +require "log4r" +require "vagrant/util/platform" +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 9ff1c0843..a11a193f0 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 -Vagrant.require "json" +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 167c0d16e..79ee6aaf8 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 -Vagrant.require "monitor" -Vagrant.require "pathname" -Vagrant.require "set" -Vagrant.require "tempfile" -Vagrant.require "fileutils" -Vagrant.require "uri" +require "monitor" +require "pathname" +require "set" +require "tempfile" +require "fileutils" +require "uri" -Vagrant.require "rubygems/package" -Vagrant.require "rubygems/uninstaller" -Vagrant.require "rubygems/name_tuple" +require "rubygems/package" +require "rubygems/uninstaller" +require "rubygems/name_tuple" require_relative "shared_helpers" require_relative "version" diff --git a/lib/vagrant/cli.rb b/lib/vagrant/cli.rb index da6b29144..17eb86e27 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 -Vagrant.require 'log4r' -Vagrant.require 'optparse' +require 'log4r' +require 'optparse' -Vagrant.require 'vagrant/util/experimental' +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 3ccce5c6f..789ce37a8 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 -Vagrant.require "vagrant/registry" +require "vagrant/registry" module Vagrant module Config diff --git a/lib/vagrant/config/v1/loader.rb b/lib/vagrant/config/v1/loader.rb index a86a53032..b567b92cd 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 -Vagrant.require "vagrant/config/v1/root" +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 1fbc3d225..f8005f6e6 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 -Vagrant.require "set" +require "set" module Vagrant module Config diff --git a/lib/vagrant/config/v2/loader.rb b/lib/vagrant/config/v2/loader.rb index f905ef8a6..beed66105 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 -Vagrant.require "vagrant/config/v2/root" +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 4f68d4292..cf2e5856b 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 -Vagrant.require "set" +require "set" -Vagrant.require "vagrant/config/v2/util" +require "vagrant/config/v2/util" module Vagrant module Config diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index ddbee8bce..366d61e0f 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 -Vagrant.require 'fileutils' -Vagrant.require 'json' -Vagrant.require 'pathname' -Vagrant.require 'set' -Vagrant.require 'thread' +require 'fileutils' +require 'json' +require 'pathname' +require 'set' +require 'thread' -Vagrant.require 'log4r' +require 'log4r' -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" +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" module Vagrant # A "Vagrant environment" represents a configuration of how Vagrant diff --git a/lib/vagrant/guest.rb b/lib/vagrant/guest.rb index bc8ae6d70..68c9177dd 100644 --- a/lib/vagrant/guest.rb +++ b/lib/vagrant/guest.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "log4r" -Vagrant.require "vagrant/capability_host" +require "log4r" +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 4f062a950..d68bedab4 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 -Vagrant.require "vagrant/capability_host" +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 3e839c5f2..616dc0a69 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -4,9 +4,9 @@ require_relative "./util/ssh" require_relative "./action/builtin/mixin_synced_folders" -Vagrant.require "digest/md5" -Vagrant.require "thread" -Vagrant.require "log4r" +require "digest/md5" +require "thread" +require "log4r" module Vagrant # This represents a machine that Vagrant manages. This provides a singular diff --git a/lib/vagrant/machine_index.rb b/lib/vagrant/machine_index.rb index 4067e2a50..56f052c05 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 -Vagrant.require "json" -Vagrant.require "pathname" -Vagrant.require "securerandom" -Vagrant.require "thread" +require "json" +require "pathname" +require "securerandom" +require "thread" -Vagrant.require "vagrant/util/silence_warnings" +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 73bd693aa..8831e3a8d 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 -Vagrant.require "fake_ftp" +require "fake_ftp" module FakeFtp class File diff --git a/lib/vagrant/patches/log4r.rb b/lib/vagrant/patches/log4r.rb index 323249543..99bde895d 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 -Vagrant.require "log4r/loggerfactory" +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 e6b3db4ce..4f505a2ce 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 -Vagrant.require "net/ssh" -Vagrant.require "net/ssh/buffer" +require "net/ssh" +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 d4a003f36..8d568141a 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 -Vagrant.require "pathname" -Vagrant.require "set" +require "pathname" +require "set" require_relative "../bundler" require_relative "../shared_helpers" diff --git a/lib/vagrant/plugin/state_file.rb b/lib/vagrant/plugin/state_file.rb index 378ee7f23..c514ca67c 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 -Vagrant.require "json" -Vagrant.require "fileutils" -Vagrant.require "tempfile" +require "json" +require "fileutils" +require "tempfile" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v1.rb b/lib/vagrant/plugin/v1.rb index b0527af28..f0f629367 100644 --- a/lib/vagrant/plugin/v1.rb +++ b/lib/vagrant/plugin/v1.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "log4r" -Vagrant.require "vagrant/plugin/v1/errors" +require "log4r" +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 b240d8ce6..f5494816d 100644 --- a/lib/vagrant/plugin/v1/command.rb +++ b/lib/vagrant/plugin/v1/command.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'log4r' -Vagrant.require "vagrant/util/safe_puts" +require 'log4r' +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 8d1aeaba3..d4180ea8e 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 -Vagrant.require "log4r" +require "log4r" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v1/plugin.rb b/lib/vagrant/plugin/v1/plugin.rb index 69e953044..0657e83ca 100644 --- a/lib/vagrant/plugin/v1/plugin.rb +++ b/lib/vagrant/plugin/v1/plugin.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "set" -Vagrant.require "log4r" +require "set" +require "log4r" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2.rb b/lib/vagrant/plugin/v2.rb index 1da18fc7c..b9264ed69 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 -Vagrant.require "log4r" +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. -Vagrant.require "vagrant/plugin/v2/components" -Vagrant.require "vagrant/plugin/v2/errors" +require "vagrant/plugin/v2/components" +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 d29d4f2a0..26252ad53 100644 --- a/lib/vagrant/plugin/v2/command.rb +++ b/lib/vagrant/plugin/v2/command.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'log4r' -Vagrant.require "vagrant/util/safe_puts" +require 'log4r' +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 f61774f37..a865a0208 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 -Vagrant.require "timeout" +require "timeout" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2/config.rb b/lib/vagrant/plugin/v2/config.rb index b0ed312ab..06352de2a 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 -Vagrant.require "set" +require "set" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2/manager.rb b/lib/vagrant/plugin/v2/manager.rb index 9b01f3a56..32218d4f8 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 -Vagrant.require "log4r" +require "log4r" module Vagrant module Plugin diff --git a/lib/vagrant/plugin/v2/plugin.rb b/lib/vagrant/plugin/v2/plugin.rb index 41fe69a02..2979160fd 100644 --- a/lib/vagrant/plugin/v2/plugin.rb +++ b/lib/vagrant/plugin/v2/plugin.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "set" -Vagrant.require "log4r" -Vagrant.require "vagrant/plugin/v2/components" +require "set" +require "log4r" +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 f13a050a9..2d1c68a75 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 -Vagrant.require "vagrant/capability_host" +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 7e64bcaeb..3f9abb55b 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 -Vagrant.require 'fileutils' -Vagrant.require 'log4r' -Vagrant.require 'shellwords' +require 'fileutils' +require 'log4r' +require 'shellwords' -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" +require Vagrant.source_root.join("plugins/provisioners/shell/provisioner") +require "vagrant/util/subprocess" +require "vagrant/util/platform" +require "vagrant/util/powershell" module Vagrant module Plugin diff --git a/lib/vagrant/shared_helpers.rb b/lib/vagrant/shared_helpers.rb index e12f6405c..1d359747b 100644 --- a/lib/vagrant/shared_helpers.rb +++ b/lib/vagrant/shared_helpers.rb @@ -21,6 +21,10 @@ module Vagrant # @note This is not the maximum time for a thread to complete. THREAD_MAX_JOIN_TIMEOUT = 60 + # List of required external tools that are expected to be + # present when running outside of the installers + REQUIRED_EXTERNAL_TOOLS = ["bsdtar", "curl", "ssh"].map(&:freeze).freeze + # This holds a global lock for the duration of the block. This should # be invoked around anything that is modifying process state (such as # environmental variables). @@ -168,7 +172,7 @@ module Vagrant if ENV["VAGRANT_ENABLE_RESOLV_REPLACE"] if !ENV["VAGRANT_DISABLE_RESOLV_REPLACE"] begin - Vagrant.require "resolv-replace" + require "resolv-replace" true rescue false @@ -192,7 +196,7 @@ module Vagrant # @return [Logger] def self.global_logger if @_global_logger.nil? - Vagrant.require "log4r" + require "log4r" @_global_logger = Log4r::Logger.new("vagrant::global") end @_global_logger @@ -226,65 +230,9 @@ 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) - - @_vagrant_activated_dependencies[dependency.name] = true + def self.detect_missing_tools + REQUIRED_EXTERNAL_TOOLS.find_all do |tool| + !Vagrant::Util::Which.which(tool) end - - # Finally, require the provided path. - ::Kernel.require(path) - - nil end end diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index 5f6259680..bd4c68af5 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -1,12 +1,12 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "delegate" -Vagrant.require "io/console" -Vagrant.require "thread" -Vagrant.require "log4r" -Vagrant.require "vagrant/util/platform" -Vagrant.require "vagrant/util/safe_puts" +require "delegate" +require "io/console" +require "thread" +require "log4r" +require "vagrant/util/platform" +require "vagrant/util/safe_puts" module Vagrant module UI diff --git a/lib/vagrant/util/caps.rb b/lib/vagrant/util/caps.rb index b9c340eb5..234335e11 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 -Vagrant.require "tempfile" -Vagrant.require "fileutils" -Vagrant.require "pathname" -Vagrant.require "vagrant/util/directory" -Vagrant.require "vagrant/util/subprocess" +require "tempfile" +require "fileutils" +require "pathname" +require "vagrant/util/directory" +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 bdf8f8ff2..8480786ca 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 -Vagrant.require "log4r" -Vagrant.require "singleton" +require "log4r" +require "singleton" module Vagrant module Util diff --git a/lib/vagrant/util/counter.rb b/lib/vagrant/util/counter.rb index 7e2c38d5e..f25a2cb11 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 -Vagrant.require 'thread' +require 'thread' module Vagrant module Util diff --git a/lib/vagrant/util/directory.rb b/lib/vagrant/util/directory.rb index 2b561ab86..55e502eab 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 -Vagrant.require 'pathname' +require 'pathname' module Vagrant module Util diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb index 55f842407..936cc000d 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 -Vagrant.require "cgi" -Vagrant.require "uri" +require "cgi" +require "uri" -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" +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" module Vagrant module Util diff --git a/lib/vagrant/util/file_checksum.rb b/lib/vagrant/util/file_checksum.rb index c6d4f8ae7..83409eb50 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. -Vagrant.require "vagrant/errors" +require "vagrant/errors" class DigestClass def update(string); end diff --git a/lib/vagrant/util/io.rb b/lib/vagrant/util/io.rb index 0202c6227..a6eada0e3 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 -Vagrant.require "vagrant/util/platform" +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 ec7c96b5f..8354dda4b 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 -Vagrant.require "socket" +require "socket" module Vagrant module Util diff --git a/lib/vagrant/util/keypair.rb b/lib/vagrant/util/keypair.rb index 0e5933060..c3ce48603 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 -Vagrant.require "base64" -Vagrant.require "ed25519" -Vagrant.require "securerandom" +require "base64" +require "ed25519" +require "securerandom" -Vagrant.require "vagrant/util/retryable" +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 b7944a484..41fc359fd 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 -Vagrant.require "vagrant/util/credential_scrubber" -Vagrant.require "log4r/formatter/formatter" +require "vagrant/util/credential_scrubber" +require "log4r/formatter/formatter" module Vagrant module Util diff --git a/lib/vagrant/util/mime.rb b/lib/vagrant/util/mime.rb index 24de8dd88..8b1036c6d 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 -Vagrant.require 'mime/types' -Vagrant.require 'securerandom' +require 'mime/types' +require 'securerandom' module Vagrant module Util diff --git a/lib/vagrant/util/network_ip.rb b/lib/vagrant/util/network_ip.rb index 0d2ec0aaa..a02752d9d 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 -Vagrant.require "ipaddr" +require "ipaddr" module Vagrant module Util diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb index 2070091ef..b99314c30 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 -Vagrant.require "rbconfig" -Vagrant.require "shellwords" -Vagrant.require "tempfile" -Vagrant.require "tmpdir" -Vagrant.require "log4r" +require "rbconfig" +require "shellwords" +require "tempfile" +require "tmpdir" +require "log4r" -Vagrant.require "vagrant/util/subprocess" -Vagrant.require "vagrant/util/powershell" -Vagrant.require "vagrant/util/which" +require "vagrant/util/subprocess" +require "vagrant/util/powershell" +require "vagrant/util/which" module Vagrant module Util diff --git a/lib/vagrant/util/powershell.rb b/lib/vagrant/util/powershell.rb index 134637ea8..2059e1ee9 100644 --- a/lib/vagrant/util/powershell.rb +++ b/lib/vagrant/util/powershell.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "base64" -Vagrant.require "tmpdir" +require "base64" +require "tmpdir" require_relative "subprocess" require_relative "which" diff --git a/lib/vagrant/util/retryable.rb b/lib/vagrant/util/retryable.rb index 60cc8617b..2e3ef18bf 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 -Vagrant.require "log4r" +require "log4r" module Vagrant module Util diff --git a/lib/vagrant/util/safe_chdir.rb b/lib/vagrant/util/safe_chdir.rb index 7314ee7bd..3dacda2e4 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 -Vagrant.require 'thread' +require 'thread' module Vagrant module Util diff --git a/lib/vagrant/util/ssh.rb b/lib/vagrant/util/ssh.rb index 8f3b74e7e..89ec5f5b6 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 -Vagrant.require "log4r" +require "log4r" -Vagrant.require 'childprocess' +require 'childprocess' -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" +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" module Vagrant module Util diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb index 19c56248f..a07e26e66 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 -Vagrant.require 'thread' +require 'thread' -Vagrant.require 'childprocess' -Vagrant.require 'log4r' +require 'childprocess' +require 'log4r' -Vagrant.require 'vagrant/util/io' -Vagrant.require 'vagrant/util/platform' -Vagrant.require 'vagrant/util/safe_chdir' -Vagrant.require 'vagrant/util/which' +require 'vagrant/util/io' +require 'vagrant/util/platform' +require 'vagrant/util/safe_chdir' +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 17d7a3aba..272e9eff6 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 -Vagrant.require 'ostruct' -Vagrant.require "pathname" +require 'ostruct' +require "pathname" -Vagrant.require 'erubi' +require 'erubi' module Vagrant module Util diff --git a/lib/vagrant/util/uploader.rb b/lib/vagrant/util/uploader.rb index 804f391b8..8e6632546 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 -Vagrant.require "uri" +require "uri" -Vagrant.require "log4r" -Vagrant.require "vagrant/util/busy" -Vagrant.require "vagrant/util/platform" -Vagrant.require "vagrant/util/subprocess" -Vagrant.require "vagrant/util/curl_helper" +require "log4r" +require "vagrant/util/busy" +require "vagrant/util/platform" +require "vagrant/util/subprocess" +require "vagrant/util/curl_helper" module Vagrant module Util diff --git a/lib/vagrant/util/which.rb b/lib/vagrant/util/which.rb index cce735f56..e84a91abb 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 -Vagrant.require "vagrant/util/platform" +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 13df069c4..bbafbdc59 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 -Vagrant.require "fiddle/import" +require "fiddle/import" module Vagrant module Util diff --git a/lib/vagrant/vagrantfile.rb b/lib/vagrant/vagrantfile.rb index 76e37d0dd..b226e6f49 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 -Vagrant.require "vagrant/util/template_renderer" -Vagrant.require "log4r" +require "vagrant/util/template_renderer" +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 b3caf0a5d..df76686fe 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 -Vagrant.require 'optparse' +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 7bc63e37b..0b9e4a87e 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 -Vagrant.require "optparse" +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 c54118477..9d33b27c6 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 -Vagrant.require 'optparse' +require 'optparse' require_relative 'download_mixins' diff --git a/plugins/commands/box/command/list.rb b/plugins/commands/box/command/list.rb index 47e41b362..d55c138b6 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandBox diff --git a/plugins/commands/box/command/outdated.rb b/plugins/commands/box/command/outdated.rb index ec754d859..71baf436a 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 -Vagrant.require 'optparse' +require 'optparse' require_relative 'download_mixins' diff --git a/plugins/commands/box/command/prune.rb b/plugins/commands/box/command/prune.rb index a456e6305..bee29993e 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandBox diff --git a/plugins/commands/box/command/remove.rb b/plugins/commands/box/command/remove.rb index 45f9f0591..9a8b88aed 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandBox diff --git a/plugins/commands/box/command/repackage.rb b/plugins/commands/box/command/repackage.rb index 193b8189a..d7de9a478 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 -Vagrant.require "fileutils" -Vagrant.require 'optparse' -Vagrant.require "pathname" +require "fileutils" +require 'optparse' +require "pathname" module VagrantPlugins module CommandBox diff --git a/plugins/commands/box/command/root.rb b/plugins/commands/box/command/root.rb index f0a0db3d2..7a62ede17 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandBox diff --git a/plugins/commands/box/command/update.rb b/plugins/commands/box/command/update.rb index 1e9c10641..34312cc51 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 -Vagrant.require 'optparse' +require 'optparse' require_relative 'download_mixins' diff --git a/plugins/commands/cap/command.rb b/plugins/commands/cap/command.rb index 93c0ee12c..dac52b749 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandCap diff --git a/plugins/commands/cloud/auth/login.rb b/plugins/commands/cloud/auth/login.rb index 59282a5c0..14dbfa7d9 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/auth/logout.rb b/plugins/commands/cloud/auth/logout.rb index 2158ea54f..c80414868 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 -Vagrant.require 'optparse' +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 2a9ec134f..423c49abd 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 -Vagrant.require "cgi" -Vagrant.require "uri" -Vagrant.require "log4r" +require "cgi" +require "uri" +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 befaf2a12..ce0de8525 100644 --- a/plugins/commands/cloud/auth/middleware/add_downloader_authentication.rb +++ b/plugins/commands/cloud/auth/middleware/add_downloader_authentication.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "cgi" -Vagrant.require "uri" -Vagrant.require "vagrant/util/credential_scrubber" +require "cgi" +require "uri" +require "vagrant/util/credential_scrubber" require Vagrant.source_root.join("plugins/commands/cloud/client/client") require_relative "./add_authentication" diff --git a/plugins/commands/cloud/auth/whoami.rb b/plugins/commands/cloud/auth/whoami.rb index f5686658c..b7e2f9111 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/box/create.rb b/plugins/commands/cloud/box/create.rb index f1ec6379e..7f92a57d0 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/box/delete.rb b/plugins/commands/cloud/box/delete.rb index 8c9621a25..85e04594d 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/box/show.rb b/plugins/commands/cloud/box/show.rb index da483e456..101387ab6 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/box/update.rb b/plugins/commands/cloud/box/update.rb index 952cc43cb..84432ef4d 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/client/client.rb b/plugins/commands/cloud/client/client.rb index 83c212fe5..fd020e973 100644 --- a/plugins/commands/cloud/client/client.rb +++ b/plugins/commands/cloud/client/client.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "vagrant_cloud" -Vagrant.require "vagrant/util/downloader" -Vagrant.require "vagrant/util/presence" +require "vagrant_cloud" +require "vagrant/util/downloader" +require "vagrant/util/presence" require Vagrant.source_root.join("plugins/commands/cloud/errors") diff --git a/plugins/commands/cloud/list.rb b/plugins/commands/cloud/list.rb index a9dd7e44a..2ec2b37fc 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/plugin.rb b/plugins/commands/cloud/plugin.rb index d0d243582..c3bc24446 100644 --- a/plugins/commands/cloud/plugin.rb +++ b/plugins/commands/cloud/plugin.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'vagrant_cloud' +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 860695367..30c55c7d6 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/provider/delete.rb b/plugins/commands/cloud/provider/delete.rb index fc09a739e..f80ebff32 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/provider/update.rb b/plugins/commands/cloud/provider/update.rb index 81d39e784..22bb6b75b 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/provider/upload.rb b/plugins/commands/cloud/provider/upload.rb index bf936a5e3..47c9f3bbe 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 -Vagrant.require 'optparse' -Vagrant.require "vagrant/util/uploader" +require 'optparse' +require "vagrant/util/uploader" module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/publish.rb b/plugins/commands/cloud/publish.rb index d56570a8b..a8e9c71b6 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 -Vagrant.require 'optparse' -Vagrant.require "vagrant/util/uploader" +require 'optparse' +require "vagrant/util/uploader" module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/search.rb b/plugins/commands/cloud/search.rb index 8cba5f720..a18793b2b 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/version/release.rb b/plugins/commands/cloud/version/release.rb index 9a204f85b..c04a14f5f 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/version/revoke.rb b/plugins/commands/cloud/version/revoke.rb index 96bb6b548..dfdaaa21e 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/cloud/version/update.rb b/plugins/commands/cloud/version/update.rb index 6e2a8ce37..380ba7498 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CloudCommand diff --git a/plugins/commands/global-status/command.rb b/plugins/commands/global-status/command.rb index d8fdc5c6f..bd0e15152 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandGlobalStatus diff --git a/plugins/commands/halt/command.rb b/plugins/commands/halt/command.rb index 5117c7ee3..9094602de 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandHalt diff --git a/plugins/commands/help/command.rb b/plugins/commands/help/command.rb index aba3a9677..23414e2c0 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandHelp diff --git a/plugins/commands/init/command.rb b/plugins/commands/init/command.rb index 2e50cbb57..45dacdcfe 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 -Vagrant.require 'optparse' +require 'optparse' require 'vagrant/util/template_renderer' diff --git a/plugins/commands/list-commands/command.rb b/plugins/commands/list-commands/command.rb index 3e2202648..d2b9e10d9 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 -Vagrant.require "optparse" +require "optparse" module VagrantPlugins module CommandListCommands diff --git a/plugins/commands/package/command.rb b/plugins/commands/package/command.rb index 3ce62da18..fd0c92ed6 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 -Vagrant.require 'optparse' -Vagrant.require 'securerandom' +require 'optparse' +require 'securerandom' module VagrantPlugins module CommandPackage diff --git a/plugins/commands/plugin/action.rb b/plugins/commands/plugin/action.rb index 10daeb32c..9a9b964a0 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 -Vagrant.require "pathname" +require "pathname" -Vagrant.require "vagrant/action/builder" +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 6018809bd..956885f25 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 -Vagrant.require "vagrant/plugin/manager" +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 45766cd43..298205568 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 -Vagrant.require "log4r" -Vagrant.require "vagrant/plugin/manager" -Vagrant.require "vagrant/util/platform" +require "log4r" +require "vagrant/plugin/manager" +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 11f33a2b0..0fb605db1 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 -Vagrant.require "fileutils" -Vagrant.require "pathname" -Vagrant.require "rubygems" -Vagrant.require "set" +require "fileutils" +require "pathname" +require "rubygems" +require "set" -Vagrant.require "log4r" +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 c2a3560c0..c6471626a 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 -Vagrant.require "vagrant/plugin/manager" +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 7c4302d61..affd68f92 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 -Vagrant.require "vagrant/plugin/manager" +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 667da4d81..713641f42 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 -Vagrant.require "vagrant/plugin/manager" +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 0bab71f2f..141090436 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 -Vagrant.require "vagrant/plugin/manager" +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 27ba1d6a6..5ca7ec37d 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 -Vagrant.require "vagrant/plugin/state_file" +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 7cb009efe..41fac5c8f 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 -Vagrant.require 'optparse' +require 'optparse' require_relative "base" diff --git a/plugins/commands/plugin/command/install.rb b/plugins/commands/plugin/command/install.rb index 4ced60228..0a80d270d 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 -Vagrant.require 'optparse' +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 0bf782ae3..b838934b4 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 -Vagrant.require 'optparse' +require 'optparse' require_relative "base" diff --git a/plugins/commands/plugin/command/list.rb b/plugins/commands/plugin/command/list.rb index 8020b922f..fab8a479f 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 -Vagrant.require 'optparse' +require 'optparse' require_relative "base" diff --git a/plugins/commands/plugin/command/repair.rb b/plugins/commands/plugin/command/repair.rb index 7762d16a3..8ed976749 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 -Vagrant.require 'optparse' +require 'optparse' require_relative "base" diff --git a/plugins/commands/plugin/command/root.rb b/plugins/commands/plugin/command/root.rb index fae441f4f..ead0fc335 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/plugin/command/uninstall.rb b/plugins/commands/plugin/command/uninstall.rb index d9bba6b29..e5ae52963 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 -Vagrant.require 'optparse' +require 'optparse' require_relative "base" diff --git a/plugins/commands/plugin/command/update.rb b/plugins/commands/plugin/command/update.rb index ac48177b5..2a472192d 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 -Vagrant.require 'optparse' +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 e66ee5a5a..30e7598d3 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 -Vagrant.require "rubygems" -Vagrant.require "rubygems/config_file" -Vagrant.require "rubygems/gem_runner" +require "rubygems" +require "rubygems/config_file" +require "rubygems/gem_runner" -Vagrant.require "log4r" +require "log4r" module VagrantPlugins module CommandPlugin diff --git a/plugins/commands/port/command.rb b/plugins/commands/port/command.rb index d0411bfeb..df36c82f6 100644 --- a/plugins/commands/port/command.rb +++ b/plugins/commands/port/command.rb @@ -3,7 +3,7 @@ require "vagrant/util/presence" -Vagrant.require "optparse" +require "optparse" module VagrantPlugins module CommandPort diff --git a/plugins/commands/powershell/command.rb b/plugins/commands/powershell/command.rb index dd13965c6..c6e366656 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 -Vagrant.require "optparse" +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 3202bccb7..ab85295a6 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandProvider diff --git a/plugins/commands/provision/command.rb b/plugins/commands/provision/command.rb index 41156bbdb..8875f6118 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandProvision diff --git a/plugins/commands/push/command.rb b/plugins/commands/push/command.rb index 801a987fd..355922614 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandPush diff --git a/plugins/commands/rdp/command.rb b/plugins/commands/rdp/command.rb index 551fda27d..5d7af813d 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 -Vagrant.require "optparse" +require "optparse" module VagrantPlugins module CommandRDP diff --git a/plugins/commands/reload/command.rb b/plugins/commands/reload/command.rb index 9cb1d7583..f8bd000d7 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 -Vagrant.require 'optparse' +require 'optparse' require "vagrant" diff --git a/plugins/commands/resume/command.rb b/plugins/commands/resume/command.rb index 9f556510c..39552757a 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 -Vagrant.require 'optparse' +require 'optparse' require Vagrant.source_root.join("plugins/commands/up/start_mixins") diff --git a/plugins/commands/snapshot/command/delete.rb b/plugins/commands/snapshot/command/delete.rb index dd83278c8..470a906a8 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandSnapshot diff --git a/plugins/commands/snapshot/command/list.rb b/plugins/commands/snapshot/command/list.rb index 68639526d..7662f5d77 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandSnapshot diff --git a/plugins/commands/snapshot/command/pop.rb b/plugins/commands/snapshot/command/pop.rb index 7b170010d..2eae941d7 100644 --- a/plugins/commands/snapshot/command/pop.rb +++ b/plugins/commands/snapshot/command/pop.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'json' -Vagrant.require 'optparse' +require 'json' +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 005a85dd7..3b860979c 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 -Vagrant.require 'json' -Vagrant.require 'optparse' +require 'json' +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 aa080b7dd..c166a3685 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 -Vagrant.require 'json' +require 'json' module VagrantPlugins module CommandSnapshot diff --git a/plugins/commands/snapshot/command/restore.rb b/plugins/commands/snapshot/command/restore.rb index aac7a8514..1b18f2bab 100644 --- a/plugins/commands/snapshot/command/restore.rb +++ b/plugins/commands/snapshot/command/restore.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'optparse' +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 330fd8eaa..8d8241dfd 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandSnapshot diff --git a/plugins/commands/snapshot/command/save.rb b/plugins/commands/snapshot/command/save.rb index 11f63c2ac..3ea4b9228 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandSnapshot diff --git a/plugins/commands/ssh/command.rb b/plugins/commands/ssh/command.rb index 95e227434..2e13f3955 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandSSH diff --git a/plugins/commands/ssh_config/command.rb b/plugins/commands/ssh_config/command.rb index 183800612..f00b2bed6 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 -Vagrant.require 'optparse' +require 'optparse' -Vagrant.require "vagrant/util/safe_puts" -Vagrant.require "vagrant/util/platform" +require "vagrant/util/safe_puts" +require "vagrant/util/platform" module VagrantPlugins module CommandSSHConfig diff --git a/plugins/commands/status/command.rb b/plugins/commands/status/command.rb index b09495b58..9c4dc6230 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandStatus diff --git a/plugins/commands/suspend/command.rb b/plugins/commands/suspend/command.rb index 727bdd8b3..114c80172 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 -Vagrant.require 'optparse' +require 'optparse' module VagrantPlugins module CommandSuspend diff --git a/plugins/commands/up/command.rb b/plugins/commands/up/command.rb index 974b059af..e7be52305 100644 --- a/plugins/commands/up/command.rb +++ b/plugins/commands/up/command.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'optparse' -Vagrant.require 'set' +require 'optparse' +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 f7c04fabf..c0101d22a 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 -Vagrant.require "set" +require "set" module VagrantPlugins module CommandUp diff --git a/plugins/commands/upload/command.rb b/plugins/commands/upload/command.rb index 5eca4e612..2276aa3a9 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 -Vagrant.require 'optparse' -Vagrant.require "rubygems/package" +require 'optparse' +require "rubygems/package" module VagrantPlugins module CommandUpload diff --git a/plugins/commands/validate/command.rb b/plugins/commands/validate/command.rb index f6f784595..e19b3bc67 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 -Vagrant.require 'optparse' +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! - Vagrant.require 'log4r' + 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 525e777a6..f931bd162 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 -Vagrant.require "optparse" +require "optparse" module VagrantPlugins module CommandVersion diff --git a/plugins/commands/winrm/command.rb b/plugins/commands/winrm/command.rb index 73af85a47..9dff72926 100644 --- a/plugins/commands/winrm/command.rb +++ b/plugins/commands/winrm/command.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'optparse' -Vagrant.require "vagrant/util/safe_puts" +require 'optparse' +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 8c6a78e1e..1a6569c73 100644 --- a/plugins/commands/winrm_config/command.rb +++ b/plugins/commands/winrm_config/command.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'optparse' +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 64f00bfb8..5c9cd1e9e 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 -Vagrant.require 'etc' -Vagrant.require 'logger' -Vagrant.require 'pathname' -Vagrant.require 'stringio' -Vagrant.require 'thread' -Vagrant.require 'timeout' +require 'etc' +require 'logger' +require 'pathname' +require 'stringio' +require 'thread' +require 'timeout' -Vagrant.require 'log4r' -Vagrant.require 'net/ssh' -Vagrant.require 'net/ssh/proxy/command' -Vagrant.require 'net/scp' +require 'log4r' +require 'net/ssh' +require 'net/ssh/proxy/command' +require 'net/scp' -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' +require 'vagrant/util/ansi_escape_code_remover' +require 'vagrant/util/file_mode' +require 'vagrant/util/keypair' +require 'vagrant/util/platform' +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 b53a3c481..09f85a39c 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 -Vagrant.require "shellwords" +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 d68b542e7..5c859cc7c 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 -Vagrant.require "shellwords" +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 563b63a47..4aedecb9f 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 -Vagrant.require "shellwords" +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 f9c757156..0be0df326 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 -Vagrant.require "shellwords" +require "shellwords" module VagrantPlugins module CommunicatorWinRM diff --git a/plugins/communicators/winrm/communicator.rb b/plugins/communicators/winrm/communicator.rb index 5655eecd0..85c055afa 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 -Vagrant.require "log4r" -Vagrant.require "tempfile" -Vagrant.require "timeout" +require "log4r" +require "tempfile" +require "timeout" require_relative "helper" require_relative "shell" diff --git a/plugins/communicators/winrm/shell.rb b/plugins/communicators/winrm/shell.rb index 761a22fc6..85e852992 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 -Vagrant.require "timeout" +require "timeout" -Vagrant.require "log4r" +require "log4r" -Vagrant.require "vagrant/util/retryable" -Vagrant.require "vagrant/util/silence_warnings" +require "vagrant/util/retryable" +require "vagrant/util/silence_warnings" Vagrant::Util::SilenceWarnings.silence! do - Vagrant.require "winrm" + require "winrm" end -Vagrant.require "winrm-elevated" -Vagrant.require "winrm-fs" +require "winrm-elevated" +require "winrm-fs" module VagrantPlugins module CommunicatorWinRM diff --git a/plugins/communicators/winssh/communicator.rb b/plugins/communicators/winssh/communicator.rb index 914c8713a..78d8811ee 100644 --- a/plugins/communicators/winssh/communicator.rb +++ b/plugins/communicators/winssh/communicator.rb @@ -3,7 +3,7 @@ require File.expand_path("../../ssh/communicator", __FILE__) -Vagrant.require "net/sftp" +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 2203134d3..9e38ae793 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 # -Vagrant.require 'set' -Vagrant.require 'tempfile' -Vagrant.require 'pathname' -Vagrant.require 'vagrant/util/template_renderer' +require 'set' +require 'tempfile' +require 'pathname' +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 affa71d47..ad31ac6ea 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 -Vagrant.require "tempfile" +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 81a431b8d..52ed72f5c 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 -Vagrant.require "ipaddr" -Vagrant.require "socket" -Vagrant.require "tempfile" +require "ipaddr" +require "socket" +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 00e1a44b2..811f58167 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 -Vagrant.require "shellwords" -Vagrant.require "vagrant/util/retryable" +require "shellwords" +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 30bd9927f..875490477 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 -Vagrant.require "tempfile" +require "tempfile" -Vagrant.require "vagrant/util/shell_quote" +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 a7ab03d84..132e691ae 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 -Vagrant.require "tempfile" -Vagrant.require "yaml" +require "tempfile" +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 f4d46ac75..1155e01bd 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 -Vagrant.require "tempfile" +require "tempfile" -Vagrant.require "vagrant/util/template_renderer" +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 028a92802..4cbfd24aa 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 -Vagrant.require "vagrant/util/retryable" -Vagrant.require "shellwords" +require "vagrant/util/retryable" +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 493d6c3b1..400289c68 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 -Vagrant.require "securerandom" +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 a67cf8303..6cd46f3df 100644 --- a/plugins/guests/debian/cap/change_host_name.rb +++ b/plugins/guests/debian/cap/change_host_name.rb @@ -1,9 +1,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "log4r" -Vagrant.require 'vagrant/util/guest_hosts' -Vagrant.require 'vagrant/util/guest_inspection' +require "log4r" +require 'vagrant/util/guest_hosts' +require 'vagrant/util/guest_inspection' require_relative "../../linux/cap/network_interfaces" diff --git a/plugins/guests/debian/cap/configure_networks.rb b/plugins/guests/debian/cap/configure_networks.rb index 9242c05a0..f6ace91ab 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 -Vagrant.require "tempfile" +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 08fdb23b5..23b94197a 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 -Vagrant.require "tempfile" +require "tempfile" -Vagrant.require "vagrant/util/shell_quote" +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 393d88fb2..4c117805a 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 -Vagrant.require "tempfile" +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 0955352be..2980c8f4a 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 -Vagrant.require "tempfile" +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 8c3edac7d..691dde903 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 -Vagrant.require "tempfile" -Vagrant.require "ipaddr" +require "tempfile" +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 db4d418db..579449dd0 100644 --- a/plugins/guests/linux/cap/mount_smb_shared_folder.rb +++ b/plugins/guests/linux/cap/mount_smb_shared_folder.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "fileutils" -Vagrant.require "shellwords" +require "fileutils" +require "shellwords" require_relative "../../../synced_folders/unix_mount_helpers" diff --git a/plugins/guests/linux/cap/public_key.rb b/plugins/guests/linux/cap/public_key.rb index 7776c0a4e..0c0a6e335 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 -Vagrant.require "tempfile" +require "tempfile" -Vagrant.require "vagrant/util/shell_quote" +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 f70bc1679..7e7c1d4f2 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 -Vagrant.require 'vagrant/util/guest_inspection' -Vagrant.require "log4r" +require 'vagrant/util/guest_inspection' +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 17fa43b5a..697e49154 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 -Vagrant.require "tempfile" +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 4e92ad188..381b373d5 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 -Vagrant.require "tempfile" +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 4d369b0f2..c4380cd32 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 -Vagrant.require "ipaddr" -Vagrant.require "tempfile" +require "ipaddr" +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 7d27a6d9d..3cbd34cde 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 -Vagrant.require "tempfile" +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 bb919953d..4886be0c0 100644 --- a/plugins/guests/redhat/cap/configure_networks.rb +++ b/plugins/guests/redhat/cap/configure_networks.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "tempfile" -Vagrant.require "securerandom" +require "tempfile" +require "securerandom" 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 dd6d42d48..c4986e8a2 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 -Vagrant.require "tempfile" +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 cd02db0b9..ac98b57bf 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 -Vagrant.require "tempfile" +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 6996c7f3d..4a7ec93ae 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 -Vagrant.require "ipaddr" +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 34db1a7e8..9300ee016 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 -Vagrant.require "log4r" +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 492669705..3c8e0c055 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 -Vagrant.require "log4r" +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 1c6df54a2..df9d1caf5 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 -Vagrant.require "vagrant/util/template_renderer" -Vagrant.require "base64" +require "vagrant/util/template_renderer" +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 54af10ae3..0316cec7f 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 -Vagrant.require "tempfile" +require "tempfile" require_relative '../../../communicators/winssh/communicator' diff --git a/plugins/guests/windows/cap/reboot.rb b/plugins/guests/windows/cap/reboot.rb index 3946a5a82..029406c34 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 -Vagrant.require "log4r" +require "log4r" module VagrantPlugins module GuestWindows diff --git a/plugins/guests/windows/guest_network.rb b/plugins/guests/windows/guest_network.rb index f5c1cd116..75f5f8fe7 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 -Vagrant.require "log4r" +require "log4r" module VagrantPlugins module GuestWindows diff --git a/plugins/hosts/bsd/cap/nfs.rb b/plugins/hosts/bsd/cap/nfs.rb index 5732a6c85..60794d85d 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 -Vagrant.require "log4r" +require "log4r" -Vagrant.require "vagrant/util" -Vagrant.require "vagrant/util/shell_quote" -Vagrant.require "vagrant/util/which" +require "vagrant/util" +require "vagrant/util/shell_quote" +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 b3e8ca968..1c0aec830 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 -Vagrant.require "socket" +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 a63ff434b..743d0747f 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 -Vagrant.require "pathname" -Vagrant.require "vagrant/util/caps" +require "pathname" +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 e6b5b4837..dc8c0f7a7 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 -Vagrant.require "pathname" -Vagrant.require "tempfile" +require "pathname" +require "tempfile" -Vagrant.require "vagrant/util/downloader" -Vagrant.require "vagrant/util/file_checksum" -Vagrant.require "vagrant/util/subprocess" +require "vagrant/util/downloader" +require "vagrant/util/file_checksum" +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 8fc05f310..27e526932 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 -Vagrant.require "pathname" -Vagrant.require "tmpdir" +require "pathname" +require "tmpdir" -Vagrant.require "vagrant/util/subprocess" +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 91016813f..6c7bc63c9 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 -Vagrant.require "pathname" -Vagrant.require "vagrant/util/caps" +require "pathname" +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 f6845bf2d..f2732c58b 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 -Vagrant.require "shellwords" -Vagrant.require "vagrant/util" -Vagrant.require "vagrant/util/shell_quote" -Vagrant.require "vagrant/util/retryable" +require "shellwords" +require "vagrant/util" +require "vagrant/util/shell_quote" +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 f394fc83e..81eb410c3 100644 --- a/plugins/hosts/linux/cap/rdp.rb +++ b/plugins/hosts/linux/cap/rdp.rb @@ -1,59 +1,59 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "vagrant/util/which" - -module VagrantPlugins - module HostLinux - module Cap - class RDP - def self.rdp_client(env, rdp_info) - # Detect if an RDP client is available. - # Prefer xfreerdp as it supports newer versions of RDP. - rdp_client = - if Vagrant::Util::Which.which("xfreerdp") - "xfreerdp" - elsif Vagrant::Util::Which.which("rdesktop") - "rdesktop" - else - if Vagrant::Util::Platform.wsl? - "mstsc.exe" - else - raise Vagrant::Errors::LinuxRDPClientNotFound - end - end - - args = [] - - # Build appropriate arguments for the RDP client. - case rdp_client - when "xfreerdp" - args << "/u:#{rdp_info[:username]}" - args << "/p:#{rdp_info[:password]}" if rdp_info[:password] - args << "/v:#{rdp_info[:host]}:#{rdp_info[:port]}" - args += rdp_info[:extra_args] if rdp_info[:extra_args] - when "rdesktop" - args << "-u" << rdp_info[:username] - args << "-p" << rdp_info[:password] if rdp_info[:password] - args += rdp_info[:extra_args] if rdp_info[:extra_args] - args << "#{rdp_info[:host]}:#{rdp_info[:port]}" - when "mstsc.exe" - # Setup password - cmdKeyArgs = [ - "/add:#{rdp_info[:host]}:#{rdp_info[:port]}", - "/user:#{rdp_info[:username]}", - "/pass:#{rdp_info[:password]}", - ] - Vagrant::Util::Subprocess.execute("cmdkey.exe", *cmdKeyArgs) - - args = ["/v:#{rdp_info[:host]}:#{rdp_info[:port]}"] - args += rdp_info[:extra_args] if rdp_info[:extra_args] - end - - # Finally, run the client. - Vagrant::Util::Subprocess.execute(rdp_client, *args, {:detach => true}) - end - end - end - end -end +require "vagrant/util/which" + +module VagrantPlugins + module HostLinux + module Cap + class RDP + def self.rdp_client(env, rdp_info) + # Detect if an RDP client is available. + # Prefer xfreerdp as it supports newer versions of RDP. + rdp_client = + if Vagrant::Util::Which.which("xfreerdp") + "xfreerdp" + elsif Vagrant::Util::Which.which("rdesktop") + "rdesktop" + else + if Vagrant::Util::Platform.wsl? + "mstsc.exe" + else + raise Vagrant::Errors::LinuxRDPClientNotFound + end + end + + args = [] + + # Build appropriate arguments for the RDP client. + case rdp_client + when "xfreerdp" + args << "/u:#{rdp_info[:username]}" + args << "/p:#{rdp_info[:password]}" if rdp_info[:password] + args << "/v:#{rdp_info[:host]}:#{rdp_info[:port]}" + args += rdp_info[:extra_args] if rdp_info[:extra_args] + when "rdesktop" + args << "-u" << rdp_info[:username] + args << "-p" << rdp_info[:password] if rdp_info[:password] + args += rdp_info[:extra_args] if rdp_info[:extra_args] + args << "#{rdp_info[:host]}:#{rdp_info[:port]}" + when "mstsc.exe" + # Setup password + cmdKeyArgs = [ + "/add:#{rdp_info[:host]}:#{rdp_info[:port]}", + "/user:#{rdp_info[:username]}", + "/pass:#{rdp_info[:password]}", + ] + Vagrant::Util::Subprocess.execute("cmdkey.exe", *cmdKeyArgs) + + args = ["/v:#{rdp_info[:host]}:#{rdp_info[:port]}"] + args += rdp_info[:extra_args] if rdp_info[:extra_args] + end + + # Finally, run the client. + Vagrant::Util::Subprocess.execute(rdp_client, *args, {:detach => true}) + end + end + end + end +end diff --git a/plugins/hosts/redhat/cap/nfs.rb b/plugins/hosts/redhat/cap/nfs.rb index 0f0e6d65c..83e8938ce 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 -Vagrant.require "pathname" +require "pathname" module VagrantPlugins module HostRedHat diff --git a/plugins/hosts/redhat/host.rb b/plugins/hosts/redhat/host.rb index bf242f50a..7c1da7e2b 100644 --- a/plugins/hosts/redhat/host.rb +++ b/plugins/hosts/redhat/host.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "pathname" +require "pathname" module VagrantPlugins module HostRedHat diff --git a/plugins/hosts/suse/host.rb b/plugins/hosts/suse/host.rb index 040b074ca..53903939e 100644 --- a/plugins/hosts/suse/host.rb +++ b/plugins/hosts/suse/host.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "pathname" +require "pathname" module VagrantPlugins module HostSUSE diff --git a/plugins/hosts/void/host.rb b/plugins/hosts/void/host.rb index d94074e78..18d12974b 100644 --- a/plugins/hosts/void/host.rb +++ b/plugins/hosts/void/host.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'pathname' +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 536a3310f..664525653 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 -Vagrant.require "pathname" -Vagrant.require "tempfile" +require "pathname" +require "tempfile" -Vagrant.require "vagrant/util/downloader" -Vagrant.require "vagrant/util/file_checksum" -Vagrant.require "vagrant/util/powershell" -Vagrant.require "vagrant/util/subprocess" +require "vagrant/util/downloader" +require "vagrant/util/file_checksum" +require "vagrant/util/powershell" +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 cf95639d3..24542601a 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 -Vagrant.require "pathname" -Vagrant.require "vagrant/util/caps" +require "pathname" +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 569037b6b..2f74af084 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 -Vagrant.require "pathname" -Vagrant.require "tempfile" +require "pathname" +require "tempfile" -Vagrant.require "vagrant/util/downloader" -Vagrant.require "vagrant/util/file_checksum" -Vagrant.require "vagrant/util/powershell" -Vagrant.require "vagrant/util/subprocess" +require "vagrant/util/downloader" +require "vagrant/util/file_checksum" +require "vagrant/util/powershell" +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 79a5fec9e..41cba15d3 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 -Vagrant.require "pathname" -Vagrant.require "tmpdir" +require "pathname" +require "tmpdir" -Vagrant.require "vagrant/util/safe_exec" +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 7e34ea68a..547fcb007 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 -Vagrant.require "pathname" -Vagrant.require "tmpdir" +require "pathname" +require "tmpdir" -Vagrant.require "vagrant/util/subprocess" +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 bb39f2c5a..435060cd3 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 -Vagrant.require "log4r" -Vagrant.require "securerandom" +require "log4r" +require "securerandom" module VagrantPlugins module Kernel_V2 diff --git a/plugins/kernel_v2/config/disk.rb b/plugins/kernel_v2/config/disk.rb index 704c5735d..8051508b6 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 -Vagrant.require "log4r" -Vagrant.require "securerandom" +require "log4r" +require "securerandom" -Vagrant.require "vagrant/util/numeric" +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 95877d6de..96980d1e1 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 -Vagrant.require "pathname" -Vagrant.require "securerandom" -Vagrant.require "set" +require "pathname" +require "securerandom" +require "set" -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 "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" 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 6e6464df2..89abf8509 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 -Vagrant.require 'log4r' +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 deb0a603f..5e8c23bad 100644 --- a/plugins/kernel_v2/config/vm_trigger.rb +++ b/plugins/kernel_v2/config/vm_trigger.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "log4r" -Vagrant.require "securerandom" +require "log4r" +require "securerandom" require Vagrant.source_root.join("plugins/provisioners/shell/config") diff --git a/plugins/providers/docker/action/build.rb b/plugins/providers/docker/action/build.rb index 82f22df6e..b56c1b54b 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 -Vagrant.require "log4r" +require "log4r" -Vagrant.require "vagrant/util/ansi_escape_code_remover" +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 3a116fbca..c2d67e9a7 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 -Vagrant.require 'ipaddr' -Vagrant.require 'log4r' +require 'ipaddr' +require 'log4r' -Vagrant.require 'vagrant/util/scoped_hash_override' +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 b0696fc62..e28b6c4a7 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 -Vagrant.require "log4r" +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 e11b12298..86131cde6 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 -Vagrant.require 'log4r' +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 a5f0f417a..460ad41fd 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 -Vagrant.require "log4r" +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 6b981fc38..3ca7903f4 100644 --- a/plugins/providers/docker/action/host_machine_build_dir.rb +++ b/plugins/providers/docker/action/host_machine_build_dir.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "digest/md5" -Vagrant.require "log4r" +require "digest/md5" +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 2ad15d7a5..96ea7ae68 100644 --- a/plugins/providers/docker/action/host_machine_sync_folders.rb +++ b/plugins/providers/docker/action/host_machine_sync_folders.rb @@ -1,11 +1,11 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "digest/md5" -Vagrant.require "securerandom" -Vagrant.require "log4r" +require "digest/md5" +require "securerandom" +require "log4r" -Vagrant.require "vagrant/action/builtin/mixin_synced_folders" +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 463faa852..639af8b12 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 -Vagrant.require "log4r" +require "log4r" -Vagrant.require "vagrant/action/builtin/mixin_synced_folders" +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 29325a1a0..02a5b18d5 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 -Vagrant.require "log4r" +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 3d44adc54..2723d4cad 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 -Vagrant.require 'ipaddr' -Vagrant.require 'log4r' +require 'ipaddr' +require 'log4r' -Vagrant.require 'vagrant/util/scoped_hash_override' +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 3863865d0..928e0d865 100644 --- a/plugins/providers/docker/action/wait_for_running.rb +++ b/plugins/providers/docker/action/wait_for_running.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "thread" -Vagrant.require "log4r" +require "thread" +require "log4r" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/communicator.rb b/plugins/providers/docker/communicator.rb index 81dcdf379..1e13485db 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 -Vagrant.require "digest/md5" -Vagrant.require "tempfile" +require "digest/md5" +require "tempfile" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/config.rb b/plugins/providers/docker/config.rb index 3b7682b44..dfababb53 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 -Vagrant.require "pathname" +require "pathname" require_relative "../../../lib/vagrant/util/platform" diff --git a/plugins/providers/docker/driver.rb b/plugins/providers/docker/driver.rb index 078a544bc..17b530ea6 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 -Vagrant.require "json" -Vagrant.require "log4r" +require "json" +require "log4r" require_relative "./driver/compose" diff --git a/plugins/providers/docker/driver/compose.rb b/plugins/providers/docker/driver/compose.rb index 2b1d42307..64a59b16f 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 -Vagrant.require "json" -Vagrant.require "log4r" +require "json" +require "log4r" module VagrantPlugins module DockerProvider diff --git a/plugins/providers/docker/provider.rb b/plugins/providers/docker/provider.rb index f14effda6..09d487470 100644 --- a/plugins/providers/docker/provider.rb +++ b/plugins/providers/docker/provider.rb @@ -1,12 +1,12 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "digest/md5" -Vagrant.require "fileutils" -Vagrant.require "thread" -Vagrant.require "log4r" +require "digest/md5" +require "fileutils" +require "thread" +require "log4r" -Vagrant.require "vagrant/util/silence_warnings" +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 ac3e3ff6a..3d4a76f4b 100644 --- a/plugins/providers/hyperv/action/check_enabled.rb +++ b/plugins/providers/hyperv/action/check_enabled.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "fileutils" -Vagrant.require "log4r" +require "fileutils" +require "log4r" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/action/configure.rb b/plugins/providers/hyperv/action/configure.rb index 207271a91..a452ecafc 100644 --- a/plugins/providers/hyperv/action/configure.rb +++ b/plugins/providers/hyperv/action/configure.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "fileutils" -Vagrant.require "log4r" +require "fileutils" +require "log4r" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/action/export.rb b/plugins/providers/hyperv/action/export.rb index 2950ef83a..1d1574077 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 -Vagrant.require "fileutils" +require "fileutils" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/action/import.rb b/plugins/providers/hyperv/action/import.rb index e592c07a7..f901d1af9 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 -Vagrant.require "fileutils" -Vagrant.require "log4r" +require "fileutils" +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 f474acd4f..d874d4385 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 -Vagrant.require "json" +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 2166c341a..e6b0147be 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 -Vagrant.require "fileutils" +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 986748467..93f0a3e91 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 -Vagrant.require "log4r" -Vagrant.require "timeout" +require "log4r" +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 4fa820c2a..51a1b07d1 100644 --- a/plugins/providers/hyperv/action/read_state.rb +++ b/plugins/providers/hyperv/action/read_state.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "log4r" +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 ca108935c..86e8b9817 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 -Vagrant.require "log4r" +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 af4371e12..9ded3031b 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 -Vagrant.require "ipaddr" -Vagrant.require "timeout" +require "ipaddr" +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 aee2e3875..1dcc1f2db 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 -Vagrant.require "log4r" -Vagrant.require "vagrant/util/experimental" +require "log4r" +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 0655e2333..f6a42e20b 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 -Vagrant.require "log4r" -Vagrant.require "fileutils" -Vagrant.require "vagrant/util/numeric" -Vagrant.require "vagrant/util/experimental" +require "log4r" +require "fileutils" +require "vagrant/util/numeric" +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 d29d218a3..208643e72 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 -Vagrant.require "log4r" +require "log4r" module VagrantPlugins module HyperV diff --git a/plugins/providers/hyperv/driver.rb b/plugins/providers/hyperv/driver.rb index a312f8fc1..23395bc16 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 -Vagrant.require "json" -Vagrant.require "log4r" +require "json" +require "log4r" -Vagrant.require "vagrant/util/powershell" +require "vagrant/util/powershell" require_relative "plugin" diff --git a/plugins/providers/hyperv/provider.rb b/plugins/providers/hyperv/provider.rb index 52b32e1f7..f23224236 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 -Vagrant.require "log4r" +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 53a63f2e9..6cdc4c684 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 -Vagrant.require "log4r" +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 9fa026eca..fd278a6a5 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 -Vagrant.require "fileutils" +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 b6669ad01..20091d6b2 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 -Vagrant.require "log4r" +require "log4r" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/export.rb b/plugins/providers/virtualbox/action/export.rb index 5098c820c..a1d27112c 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 -Vagrant.require "fileutils" -Vagrant.require 'vagrant/util/platform' +require "fileutils" +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 58f7ebd04..9bdb94168 100644 --- a/plugins/providers/virtualbox/action/import_master.rb +++ b/plugins/providers/virtualbox/action/import_master.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "log4r" -Vagrant.require "digest/md5" +require "log4r" +require "digest/md5" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/action/network.rb b/plugins/providers/virtualbox/action/network.rb index 08799c320..13342932a 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 -Vagrant.require "ipaddr" -Vagrant.require "resolv" -Vagrant.require "set" +require "ipaddr" +require "resolv" +require "set" -Vagrant.require "log4r" +require "log4r" -Vagrant.require "vagrant/util/network_ip" -Vagrant.require "vagrant/util/scoped_hash_override" +require "vagrant/util/network_ip" +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 e1abe8452..2de31b57d 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 -Vagrant.require "ipaddr" -Vagrant.require "socket" +require "ipaddr" +require "socket" -Vagrant.require "log4r" +require "log4r" -Vagrant.require "vagrant/util/presence" -Vagrant.require "vagrant/util/scoped_hash_override" +require "vagrant/util/presence" +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 69eec8abf..9be34e6a5 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 -Vagrant.require "fileutils" +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 8b9c113d0..593de3cfd 100644 --- a/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb +++ b/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "log4r" -Vagrant.require "digest/md5" +require "log4r" +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 4c4772f4f..f8dc98563 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 -Vagrant.require "ipaddr" -Vagrant.require "vagrant/action/builtin/mixin_synced_folders" +require "ipaddr" +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 212a31a0c..6b4a0d8ab 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 -Vagrant.require "log4r" +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 057307383..514fca67d 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 -Vagrant.require "log4r" +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 17a3e2f43..491c74561 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 -Vagrant.require "log4r" +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 179233dc4..76d76439b 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 -Vagrant.require "log4r" +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 0d6918bfa..ca4aecb89 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 -Vagrant.require "log4r" -Vagrant.require "vagrant/util/experimental" +require "log4r" +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 365fdb316..501a6354a 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 -Vagrant.require "log4r" -Vagrant.require "fileutils" -Vagrant.require "vagrant/util/numeric" -Vagrant.require "vagrant/util/experimental" +require "log4r" +require "fileutils" +require "vagrant/util/numeric" +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 2f5f87058..00f3d0efc 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 -Vagrant.require "log4r" +require "log4r" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/driver/base.rb b/plugins/providers/virtualbox/driver/base.rb index ea229b640..7d1739ba2 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 -Vagrant.require 'log4r' +require 'log4r' -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' +require 'vagrant/util/busy' +require 'vagrant/util/platform' +require 'vagrant/util/retryable' +require 'vagrant/util/subprocess' +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 a892ab3b5..425de8f5e 100644 --- a/plugins/providers/virtualbox/driver/version_4_1.rb +++ b/plugins/providers/virtualbox/driver/version_4_1.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'log4r' -Vagrant.require "vagrant/util/platform" +require 'log4r' +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 e6e1b473c..12fa47119 100644 --- a/plugins/providers/virtualbox/driver/version_7_0.rb +++ b/plugins/providers/virtualbox/driver/version_7_0.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "rexml" +require "rexml" require File.expand_path("../version_6_1", __FILE__) diff --git a/plugins/providers/virtualbox/provider.rb b/plugins/providers/virtualbox/provider.rb index 16abd44ff..de934c072 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 -Vagrant.require "log4r" +require "log4r" module VagrantPlugins module ProviderVirtualBox diff --git a/plugins/providers/virtualbox/synced_folder.rb b/plugins/providers/virtualbox/synced_folder.rb index 771de1c74..623d0f9e1 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 -Vagrant.require "fileutils" -Vagrant.require "vagrant/util/platform" +require "fileutils" +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 9727037e5..e4bf53eec 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 -Vagrant.require "tempfile" +require "tempfile" require_relative "base" diff --git a/plugins/provisioners/ansible/provisioner/host.rb b/plugins/provisioners/ansible/provisioner/host.rb index 577be9bff..9f9dc5d0d 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 -Vagrant.require "thread" +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 fc543f773..bc1ec929e 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 -Vagrant.require "log4r" +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 b77e4d866..6c7533598 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 -Vagrant.require "log4r" +require "log4r" module VagrantPlugins module CFEngine diff --git a/plugins/provisioners/cfengine/config.rb b/plugins/provisioners/cfengine/config.rb index 57ca872fb..5da6658fd 100644 --- a/plugins/provisioners/cfengine/config.rb +++ b/plugins/provisioners/cfengine/config.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "pathname" +require "pathname" module VagrantPlugins module CFEngine diff --git a/plugins/provisioners/cfengine/provisioner.rb b/plugins/provisioners/cfengine/provisioner.rb index 66dcddc99..72711fbbd 100644 --- a/plugins/provisioners/cfengine/provisioner.rb +++ b/plugins/provisioners/cfengine/provisioner.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "log4r" +require "log4r" module VagrantPlugins module CFEngine diff --git a/plugins/provisioners/chef/plugin.rb b/plugins/provisioners/chef/plugin.rb index df450767b..2f5a50718 100644 --- a/plugins/provisioners/chef/plugin.rb +++ b/plugins/provisioners/chef/plugin.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "pathname" +require "pathname" require_relative "command_builder" diff --git a/plugins/provisioners/chef/provisioner/base.rb b/plugins/provisioners/chef/provisioner/base.rb index 042123a42..fad7574b1 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 -Vagrant.require "tempfile" +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 ae69cfddd..74f2033c0 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 -Vagrant.require "digest/md5" -Vagrant.require "tempfile" +require "digest/md5" +require "tempfile" require_relative "base" diff --git a/plugins/provisioners/chef/provisioner/chef_client.rb b/plugins/provisioners/chef/provisioner/chef_client.rb index b917606a1..c6f939ad6 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 -Vagrant.require 'pathname' +require 'pathname' -Vagrant.require 'vagrant' -Vagrant.require 'vagrant/util/presence' -Vagrant.require 'vagrant/util/subprocess' +require 'vagrant' +require 'vagrant/util/presence' +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 c2837dd78..a3a47057b 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 -Vagrant.require "digest/md5" -Vagrant.require "securerandom" -Vagrant.require "set" +require "digest/md5" +require "securerandom" +require "set" -Vagrant.require "log4r" +require "log4r" -Vagrant.require "vagrant/util/counter" +require "vagrant/util/counter" require_relative "chef_solo" diff --git a/plugins/provisioners/container/client.rb b/plugins/provisioners/container/client.rb index 57fd2fabe..d04f43a05 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 -Vagrant.require 'digest/sha1' +require 'digest/sha1' module VagrantPlugins module ContainerProvisioner diff --git a/plugins/provisioners/container/config.rb b/plugins/provisioners/container/config.rb index f910b9202..9edc6fa63 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 -Vagrant.require 'set' +require 'set' module VagrantPlugins module ContainerProvisioner diff --git a/plugins/provisioners/file/config.rb b/plugins/provisioners/file/config.rb index 0e8fe80b3..ed4be6bbe 100644 --- a/plugins/provisioners/file/config.rb +++ b/plugins/provisioners/file/config.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "pathname" +require "pathname" module VagrantPlugins module FileUpload diff --git a/plugins/provisioners/puppet/provisioner/puppet.rb b/plugins/provisioners/puppet/provisioner/puppet.rb index 39404ec35..8628e30da 100644 --- a/plugins/provisioners/puppet/provisioner/puppet.rb +++ b/plugins/provisioners/puppet/provisioner/puppet.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require "digest/md5" -Vagrant.require "log4r" +require "digest/md5" +require "log4r" module VagrantPlugins module Puppet diff --git a/plugins/provisioners/salt/bootstrap_downloader.rb b/plugins/provisioners/salt/bootstrap_downloader.rb index 2b048f8e0..a81c94c8e 100644 --- a/plugins/provisioners/salt/bootstrap_downloader.rb +++ b/plugins/provisioners/salt/bootstrap_downloader.rb @@ -1,8 +1,8 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'open-uri' -Vagrant.require 'digest' +require 'open-uri' +require 'digest' require_relative "./errors" diff --git a/plugins/provisioners/salt/provisioner.rb b/plugins/provisioners/salt/provisioner.rb index a7d96dc8f..44cb84c15 100644 --- a/plugins/provisioners/salt/provisioner.rb +++ b/plugins/provisioners/salt/provisioner.rb @@ -1,7 +1,7 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -Vagrant.require 'json' +require 'json' require_relative "bootstrap_downloader" diff --git a/plugins/provisioners/shell/config.rb b/plugins/provisioners/shell/config.rb index 8a1e2013d..ce10c6bf9 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 -Vagrant.require 'uri' +require 'uri' module VagrantPlugins module Shell diff --git a/plugins/provisioners/shell/provisioner.rb b/plugins/provisioners/shell/provisioner.rb index fc320b49a..e1cf59149 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 -Vagrant.require "pathname" -Vagrant.require "tempfile" +require "pathname" +require "tempfile" -Vagrant.require "vagrant/util/downloader" -Vagrant.require "vagrant/util/line_buffer" -Vagrant.require "vagrant/util/retryable" +require "vagrant/util/downloader" +require "vagrant/util/line_buffer" +require "vagrant/util/retryable" module VagrantPlugins module Shell diff --git a/plugins/pushes/ftp/adapter.rb b/plugins/pushes/ftp/adapter.rb index 208511374..535d44625 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 -Vagrant.require "pathname" +require "pathname" module VagrantPlugins module FTPPush @@ -50,7 +50,7 @@ module VagrantPlugins # class FTPAdapter < Adapter def initialize(*) - Vagrant.require "net/ftp" + require "net/ftp" super end @@ -107,7 +107,7 @@ module VagrantPlugins # class SFTPAdapter < Adapter def initialize(*) - Vagrant.require "net/sftp" + require "net/sftp" super @dirs = {} end diff --git a/plugins/pushes/ftp/push.rb b/plugins/pushes/ftp/push.rb index 5717c9849..9c85a001d 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 -Vagrant.require "net/ftp" -Vagrant.require "pathname" +require "net/ftp" +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 e1e1c2cdf..0d4202198 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 -Vagrant.require "fileutils" -Vagrant.require "tempfile" -Vagrant.require "vagrant/util/safe_exec" +require "fileutils" +require "tempfile" +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 b3f526310..eadf865da 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 -Vagrant.require "log4r" +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 4bb8e27da..44efcf37a 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 -Vagrant.require 'fileutils' -Vagrant.require 'thread' -Vagrant.require 'zlib' +require 'fileutils' +require 'thread' +require 'zlib' -Vagrant.require "log4r" +require "log4r" -Vagrant.require "vagrant/util/platform" +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 a02c2ace7..8268b32d2 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 -Vagrant.require 'optparse' +require 'optparse' -Vagrant.require "vagrant/action/builtin/mixin_synced_folders" +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 bcc093251..b269ddb97 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 -Vagrant.require "log4r" -Vagrant.require 'optparse' -Vagrant.require "thread" +require "log4r" +require 'optparse' +require "thread" -Vagrant.require "vagrant/action/builtin/mixin_synced_folders" -Vagrant.require "vagrant/util/busy" -Vagrant.require "vagrant/util/platform" +require "vagrant/action/builtin/mixin_synced_folders" +require "vagrant/util/busy" +require "vagrant/util/platform" require_relative "../helper" -Vagrant.require "listen" +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 91371ff79..f39244a33 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 -Vagrant.require "shellwords" +require "shellwords" module VagrantPlugins module SyncedFolderRSync diff --git a/plugins/synced_folders/rsync/helper.rb b/plugins/synced_folders/rsync/helper.rb index 91c94b7b8..d6c2180eb 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 -Vagrant.require "fileutils" -Vagrant.require "ipaddr" -Vagrant.require "shellwords" -Vagrant.require "tmpdir" +require "fileutils" +require "ipaddr" +require "shellwords" +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 28971a9fc..caef81e60 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 -Vagrant.require "log4r" +require "log4r" -Vagrant.require "vagrant/util/subprocess" -Vagrant.require "vagrant/util/which" +require "vagrant/util/subprocess" +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 53292c887..4b18e8252 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 -Vagrant.require "digest/md5" -Vagrant.require "json" +require "digest/md5" +require "json" -Vagrant.require "log4r" +require "log4r" -Vagrant.require "vagrant/util/platform" -Vagrant.require "vagrant/util/powershell" +require "vagrant/util/platform" +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 3462f1274..88269ec4a 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 -Vagrant.require "shellwords" -Vagrant.require "vagrant/util/retryable" +require "shellwords" +require "vagrant/util/retryable" module VagrantPlugins module SyncedFolder diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 63741e9fc..aecce4318 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -437,10 +437,10 @@ en: not_in_installer: |- You appear to be running Vagrant outside of the official installers. Note that the installers are what ensure that Vagrant has all required - dependencies, and Vagrant assumes that these dependencies exist. By - running outside of the installer environment, Vagrant may not function - properly. To remove this warning, install Vagrant using one of the - official packages from vagrantup.com. + dependencies. Vagrant has detected that the following executables are + currently unavailable: + + %{tools} upgraded_v1_dotfile: |- A Vagrant 1.0.x state file was found for this environment. Vagrant has gone ahead and auto-upgraded this to the latest format. Everything diff --git a/test/unit/bin/vagrant_test.rb b/test/unit/bin/vagrant_test.rb index ff2b5a8a5..c04d797d9 100644 --- a/test/unit/bin/vagrant_test.rb +++ b/test/unit/bin/vagrant_test.rb @@ -132,19 +132,19 @@ describe "vagrant bin" do before do expect(Vagrant).to receive(:in_installer?).and_return(false) - allow(I18n).to receive(:t).with(/not_in_installer/).and_return(warning) + allow(I18n).to receive(:t).with(/not_in_installer/, any_args).and_return(warning) end - context "when vagrant is not very quiet" do - before { expect(Vagrant).to receive(:very_quiet?).and_return(false) } + context "when tool is missing" do + before { expect(Vagrant).to receive(:detect_missing_tools).and_return(["tool"]) } it "should output a warning" do expect(env.ui).to receive(:warn).with(/#{warning}/, any_args) end end - context "when vagrant is very quiet" do - before { expect(Vagrant).to receive(:very_quiet?).and_return(true) } + context "when tool is not missing" do + before { expect(Vagrant).to receive(:detect_missing_tools).and_return([]) } it "should not output a warning" do expect(env.ui).not_to receive(:warn).with(/#{warning}/, any_args)