Change default `config.chef.cookbooks_path` to handle typical default behavior for remote cookbooks
This commit is contained in:
parent
e63cd71673
commit
0052f2515c
|
@ -28,7 +28,7 @@ module Vagrant
|
|||
@client_key_path = "/etc/chef/client.pem"
|
||||
@node_name = "client"
|
||||
|
||||
@cookbooks_path = "cookbooks"
|
||||
@cookbooks_path = ["cookbooks", [:vm, "cookbooks"]]
|
||||
@roles_path = []
|
||||
@provisioning_path = "/tmp/vagrant-chef"
|
||||
@log_level = :info
|
||||
|
|
|
@ -106,10 +106,7 @@ module Vagrant
|
|||
end
|
||||
|
||||
def cookbooks_path
|
||||
result = folders_path(env.config.chef.cookbooks_path, "cookbooks")
|
||||
result = [result, File.join(env.config.chef.provisioning_path, "cookbooks")].flatten if env.config.chef.recipe_url
|
||||
|
||||
result.to_json
|
||||
folders_path(env.config.chef.cookbooks_path, "cookbooks").to_json
|
||||
end
|
||||
|
||||
def roles_path
|
||||
|
|
|
@ -142,14 +142,6 @@ class ChefSoloProvisionerTest < Test::Unit::TestCase
|
|||
@action.expects(:folders_path).with(@env.config.chef.cookbooks_path, "cookbooks").once.returns(result)
|
||||
assert_equal result.to_json, @action.cookbooks_path
|
||||
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
|
||||
|
||||
context "roles path" do
|
||||
|
|
Loading…
Reference in New Issue