Skip to content

Commit f0f75d8

Browse files
committed
Mark provider as non-defaultable
Since creating a DigitalOcean droplet requires a token to be specified in the Vagrantfile, this provider will not work out-of-the-box with any arbitrary Vagrantfile. This is a problem for users who have DigitalOcean first in their provider list (e.g. by having none of the default providers' backends installed) and a working provider later in the list. DigitalOcean will return an "unauthorized" response and prevent Vagrant from trying later providers, forcing the user to manually specify their desired provider. Additionally, as droplets begin to incur a fee as soon as they're created, defaulting to the DigitalOcean provider for Vagrantfiles that make no mention of it might cause users to receive an unintentional bill--for example, in the case where they've specified their DigitalOcean token in a user- or system-wide Vagrantfile. This commit has no effect on the current behavior in cases where - a Vagrantfile contains a "config.vm.provider :digital_ocean" section - a user passes a provider explicitly on the command line - the VAGRANT_DEFAULT_PROVIDER environment variable is set Signed-off-by: Thomas Hebb <[email protected]>
1 parent f3991dd commit f0f75d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/vagrant-digitalocean/plugin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Plugin < Vagrant.plugin('2')
1212
Config
1313
end
1414

15-
provider(:digital_ocean, parallel: true) do
15+
provider(:digital_ocean, parallel: true, defaultable: false) do
1616
require_relative 'provider'
1717
Provider
1818
end

0 commit comments

Comments
 (0)