Check for empty chef_server_url and validation_key_path

This commit is contained in:
Seth Vargo 2014-10-30 11:42:15 -04:00
parent 6814f9c97d
commit 7e71d72db8
1 changed files with 8 additions and 4 deletions

View File

@ -38,10 +38,14 @@ module VagrantPlugins
def validate(machine) def validate(machine)
errors = _detected_errors errors = _detected_errors
errors.concat(validate_base(machine)) errors.concat(validate_base(machine))
errors << I18n.t("vagrant.config.chef.server_url_empty") if \
!chef_server_url || chef_server_url.strip == "" if chef_server_url.to_s.strip.empty?
errors << I18n.t("vagrant.config.chef.validation_key_path") if \ errors << I18n.t("vagrant.config.chef.server_url_empty")
!validation_key_path 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 delete_client || delete_node
if !Vagrant::Util::Which.which("knife") if !Vagrant::Util::Which.which("knife")