From 58eac7117b7cb2d84eb7f52092aeb9f1849d08db Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 18 Jan 2013 13:36:12 -0800 Subject: [PATCH] Only merge provider/provisioner errors if they exist --- plugins/kernel_v2/config/vm.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index 7021727b9..3df3c5ca1 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -151,14 +151,18 @@ module VagrantPlugins # Validate only the _active_ provider if machine.provider_config provider_errors = machine.provider_config.validate(machine) - errors = Vagrant::Config::V2::Util.merge_errors(errors, provider_errors) + if provider_errors + errors = Vagrant::Config::V2::Util.merge_errors(errors, provider_errors) + end end # Validate provisioners @provisioners.each do |vm_provisioner| if vm_provisioner.config provisioner_errors = vm_provisioner.config.validate(machine) - errors = Vagrant::Config::V2::Util.merge_errors(errors, provisioner_errors) + if provisioner_errors + errors = Vagrant::Config::V2::Util.merge_errors(errors, provisioner_errors) + end end end