Added exception if chef.node_path is defined on Vagrantfile but the directory does not exist locally

This commit is contained in:
Eugenio Marzo 2017-07-12 15:27:10 +02:00
parent 4d30018665
commit dd3d782659
2 changed files with 9 additions and 0 deletions

View File

@ -35,6 +35,7 @@ module VagrantPlugins
upload_encrypted_data_bag_secret
setup_json
setup_zero_config
verify_chef_nodes_folder
run_chef_zero
delete_encrypted_data_bag_secret
end
@ -101,6 +102,12 @@ module VagrantPlugins
end
end
def verify_chef_nodes_folder
if not File.exists? @config.nodes_path[0][1]
raise ChefError, :missing_chef_node_folder
end
end
protected
# Extracts only the remote paths from a list of folders

View File

@ -2192,6 +2192,8 @@ en:
running_solo_again: "Running chef-solo again (failed to converge)..."
running_zero: "Running chef-client (local-mode)..."
running_zero_again: "Running chef-client (local-mode) again (failed to converge)..."
missing_chef_node_folder: |-
Nodes folder that Chef requires is missing in this Vagrant project
missing_shared_folders: |-
Shared folders that Chef requires are missing on the virtual machine.
This is usually due to configuration changing after already booting the