From 19a7e24f1fb9c5bfad0b76c73829ea77a2d957fe Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 13 Sep 2021 16:36:17 -0700 Subject: [PATCH] Vagrantfile: Remove workarounds for ancient Vagrant bugs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vagrant 2.2.6 is the earliest version with the Docker usability test fix, and is also conveniently the version in the Ubuntu 20.04 repository. Users with older versions will get a friendly error message from ‘Vagrant.require_version’ (and can install an updated Vagrant from upstream). Signed-off-by: Anders Kaseorg --- Vagrantfile | 41 ++--------------------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 437e7c831e..a079fea520 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,45 +1,8 @@ # -*- mode: ruby -*- -VAGRANTFILE_API_VERSION = "2" - -if Vagrant::VERSION == "1.8.7" - path = `command -v curl` - if path.include?("/opt/vagrant/embedded/bin/curl") - puts "In Vagrant 1.8.7, curl is broken. Please use the latest Vagrant." - puts "See https://github.com/mitchellh/vagrant/issues/7997 for details." - exit - end -end - -# Workaround: Vagrant removed the atlas.hashicorp.com to -# vagrantcloud.com redirect in February 2018. The value of -# DEFAULT_SERVER_URL in Vagrant versions less than 1.9.3 is -# atlas.hashicorp.com, which means that removal broke the fetching and -# updating of boxes (since the old URL doesn't work). See -# https://github.com/hashicorp/vagrant/issues/9442 -if Vagrant::DEFAULT_SERVER_URL == "atlas.hashicorp.com" - Vagrant::DEFAULT_SERVER_URL.replace("https://vagrantcloud.com") -end - -# Monkey patch https://github.com/hashicorp/vagrant/pull/10879 so we -# can fall back to another provider if docker is not installed. -begin - require Vagrant.source_root.join("plugins", "providers", "docker", "provider") -rescue LoadError -else - VagrantPlugins::DockerProvider::Provider.class_eval do - method(:usable?).owner == singleton_class or def self.usable?(raise_error = false) - VagrantPlugins::DockerProvider::Driver.new.execute("docker", "version") - true - rescue Vagrant::Errors::CommandUnavailable, VagrantPlugins::DockerProvider::Errors::ExecuteError - raise if raise_error - return false - end - end -end - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| +Vagrant.require_version ">= 2.2.6" +Vagrant.configure("2") do |config| # The Zulip development environment runs on 9991 on the guest. host_port = 9991 http_proxy = https_proxy = no_proxy = nil