Make configured VM providers default to an empty one

This commit is contained in:
Mitchell Hashimoto 2012-12-23 11:02:51 -08:00
parent 553d4a828a
commit e88d735cb6
2 changed files with 6 additions and 4 deletions

View File

@ -213,9 +213,7 @@ module Vagrant
end
# Get the provider configuration from the final loaded configuration
vm_provider = config.vm.providers[provider]
provider_config = nil
provider_config = vm_provider.config if vm_provider
provider_config = config.vm.providers[provider].config
# Create the machine and cache it for future calls. This will also
# return the machine from this method.

View File

@ -28,8 +28,12 @@ module VagrantPlugins
@forwarded_ports = []
@shared_folders = {}
@networks = []
@providers = {}
@provisioners = []
# The providers hash defaults any key to a provider object
@providers = Hash.new do |hash, key|
hash[key] = VagrantConfigProvider.new(key, nil)
end
end
# Custom merge method since some keys here are merged differently.