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