Remove the chef dependency on the default 'v-root' shared folder.
This commit is contained in:
parent
c48c7611b3
commit
dcef64fa0d
|
@ -57,10 +57,10 @@ module Vagrant
|
|||
env.ui.info I18n.t("vagrant.provisioners.chef.json")
|
||||
|
||||
# Set up initial configuration
|
||||
data = {
|
||||
:config => env.config.to_hash,
|
||||
:directory => env.config.vm.shared_folders["v-root"][:guestpath],
|
||||
}
|
||||
data, default_share = { :config => env.config.to_hash }, env.config.vm.shared_folders["v-root"]
|
||||
|
||||
# Add the directory on the guest if the default shared folder exists
|
||||
data[:directory] = default_share[:guestpath] if default_share
|
||||
|
||||
# And wrap it under the "vagrant" namespace
|
||||
data = { :vagrant => data }
|
||||
|
|
|
@ -186,6 +186,13 @@ class ChefProvisionerTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
should "not add the directory if the 'v-root' shared folder doesn't exist" do
|
||||
@env.config.vm.shared_folders.delete("v-root")
|
||||
assert_json do |data|
|
||||
assert !data["vagrant"].has_key?("directory")
|
||||
end
|
||||
end
|
||||
|
||||
should "add the config to the JSON" do
|
||||
assert_json do |data|
|
||||
assert_equal @env.config.ssh.username, data["vagrant"]["config"]["ssh"]["username"]
|
||||
|
|
Loading…
Reference in New Issue