From 7e71d72db8cdb92662bc522c0b4b879c97e4a9f1 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Thu, 30 Oct 2014 11:42:15 -0400 Subject: [PATCH] Check for empty chef_server_url and validation_key_path --- plugins/provisioners/chef/config/chef_client.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/provisioners/chef/config/chef_client.rb b/plugins/provisioners/chef/config/chef_client.rb index e1585c084..4805310b3 100644 --- a/plugins/provisioners/chef/config/chef_client.rb +++ b/plugins/provisioners/chef/config/chef_client.rb @@ -38,10 +38,14 @@ module VagrantPlugins def validate(machine) errors = _detected_errors errors.concat(validate_base(machine)) - errors << I18n.t("vagrant.config.chef.server_url_empty") if \ - !chef_server_url || chef_server_url.strip == "" - errors << I18n.t("vagrant.config.chef.validation_key_path") if \ - !validation_key_path + + if chef_server_url.to_s.strip.empty? + errors << I18n.t("vagrant.config.chef.server_url_empty") + end + + if validation_key_path.to_s.strip.empty? + errors << I18n.t("vagrant.config.chef.validation_key_path") + end if delete_client || delete_node if !Vagrant::Util::Which.which("knife")