From a09c72d84ea8d47da817f71f704826d53259b066 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 5 Feb 2013 21:33:00 -0800 Subject: [PATCH] Properly default provider configs if not specified --- plugins/kernel_v2/config/vm.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index 426cd0925..551fcebc5 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -174,7 +174,19 @@ module VagrantPlugins def get_provider_config(name) raise "Must finalize first." if !@__finalized - @__compiled_provider_configs[name] + result = @__compiled_provider_configs[name] + + # If no compiled configuration was found, then we try to just + # use the default configuration from the plugin. + if !result + config_class = Vagrant.plugin("2").manager.provider_configs[name] + if config_class + result = config_class.new + result.finalize! + end + end + + return result end def validate(machine)