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")