Make sure synced folder types are always symbols

This will make sure that plugins that define synced folders after this
config object has been finalized won't have trouble because of
forgetting to use symbols instead of strings.

References https://github.com/fgrehm/vagrant-cachier/issues/76
This commit is contained in:
Fabio Rehm 2014-02-01 16:01:02 -02:00
parent bc55081e9f
commit dd9d20af88
1 changed files with 2 additions and 3 deletions

View File

@ -150,6 +150,8 @@ module VagrantPlugins
options = options.dup options = options.dup
options[:guestpath] = guestpath.to_s.gsub(/\/$/, '') options[:guestpath] = guestpath.to_s.gsub(/\/$/, '')
options[:hostpath] = hostpath options[:hostpath] = hostpath
# Make sure the type is a symbol
options[:type] = options[:type].to_sym if options[:type]
@__synced_folders[options[:guestpath]] = options @__synced_folders[options[:guestpath]] = options
end end
@ -324,9 +326,6 @@ module VagrantPlugins
options[:type] = :nfs options[:type] = :nfs
end end
# Make sure the type is a symbol
options[:type] = options[:type].to_sym if options[:type]
# Ignore NFS on Windows # Ignore NFS on Windows
if options[:type] == :nfs && Vagrant::Util::Platform.windows? if options[:type] == :nfs && Vagrant::Util::Platform.windows?
options.delete(:type) options.delete(:type)