Change default `config.chef.cookbooks_path` to handle typical default behavior for remote cookbooks

This commit is contained in:
Mitchell Hashimoto 2010-07-31 10:53:57 -07:00
parent e63cd71673
commit 0052f2515c
3 changed files with 2 additions and 13 deletions

View File

@ -28,7 +28,7 @@ module Vagrant
@client_key_path = "/etc/chef/client.pem" @client_key_path = "/etc/chef/client.pem"
@node_name = "client" @node_name = "client"
@cookbooks_path = "cookbooks" @cookbooks_path = ["cookbooks", [:vm, "cookbooks"]]
@roles_path = [] @roles_path = []
@provisioning_path = "/tmp/vagrant-chef" @provisioning_path = "/tmp/vagrant-chef"
@log_level = :info @log_level = :info

View File

@ -106,10 +106,7 @@ module Vagrant
end end
def cookbooks_path def cookbooks_path
result = folders_path(env.config.chef.cookbooks_path, "cookbooks") folders_path(env.config.chef.cookbooks_path, "cookbooks").to_json
result = [result, File.join(env.config.chef.provisioning_path, "cookbooks")].flatten if env.config.chef.recipe_url
result.to_json
end end
def roles_path def roles_path

View File

@ -142,14 +142,6 @@ class ChefSoloProvisionerTest < Test::Unit::TestCase
@action.expects(:folders_path).with(@env.config.chef.cookbooks_path, "cookbooks").once.returns(result) @action.expects(:folders_path).with(@env.config.chef.cookbooks_path, "cookbooks").once.returns(result)
assert_equal result.to_json, @action.cookbooks_path assert_equal result.to_json, @action.cookbooks_path
end end
should "append a bare cookbooks path to the cookbooks path for recipe URL" do
@env.config.chef.recipe_url = "foo"
@action.stubs(:folders_path).returns([])
result = @action.cookbooks_path
assert result
assert result =~ /\/cookbooks"\]$/
end
end end
context "roles path" do context "roles path" do