Only merge provider/provisioner errors if they exist

This commit is contained in:
Mitchell Hashimoto 2013-01-18 13:36:12 -08:00
parent d64c164727
commit 58eac7117b
1 changed files with 6 additions and 2 deletions

View File

@ -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