Skip to content

Commit

Permalink
Fix Vagrantfile for 2.0.3+
Browse files Browse the repository at this point in the history
With Vagrant 2.0.3 and up, the DEFAULT_SERVER_URL is frozen, so it cannot be changed. But earlier versions of Vagrant need this line to work. While we could mandate a minimum Vagrant version, this change would set the correct URL if it's wrong, and leave it alone if the Vagrant version is new enough not to need it.

In hashicorp/vagrant#9442 this fix was posted by @reedy, credit where credit is due.
  • Loading branch information
ocdtrekkie authored Apr 21, 2018
1 parent 08fc4db commit e0c1d4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vagrant-spk
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ VM_NAME = File.basename(File.dirname(File.dirname(__FILE__))) + "_sandstorm_#{Ti
VAGRANTFILE_API_VERSION = "2"
# ugly hack to prevent hashicorp's bitrot. See https://github.com/hashicorp/vagrant/issues/9442
Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
unless Vagrant::DEFAULT_SERVER_URL.frozen?
Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Base on the Sandstorm snapshots of the official Debian 8 (jessie) box.
Expand Down

0 comments on commit e0c1d4c

Please sign in to comment.