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"
|
@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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue