Another try, without string substitution

This commit is contained in:
Carlos Rodrigues 2016-07-24 18:40:09 +01:00
parent 9ebc028745
commit 188a7dab0c
1 changed files with 4 additions and 9 deletions

View File

@ -157,21 +157,16 @@ module Vagrant
end
# Setup the local data directory. If a configuration path is given,
# it is expanded relative to the root path or to the working directory
# depending on whether it starts with the "{}" placeholder. Otherwise,
# we use the default which is expanded relative to the root path.
# it is expanded relative to the root path. Otherwise, we use the
# default (which is also expanded relative to the root path).
if ENV.has_key?("VAGRANT_DOTFILE_PATH") && !opts[:child]
dotfile_path = ENV["VAGRANT_DOTFILE_PATH"]
if dotfile_path.match(/^\{\}/) && !root_path.nil?
opts[:local_data_path] = File.join(root_path, dotfile_path.sub(/^\{\}/, ''))
else
opts[:local_data_path] = dotfile_path
end
opts[:local_data_path] ||= root_path.join(ENV["VAGRANT_DOTFILE_PATH"]) if !root_path.nil?
end
opts[:local_data_path] ||= root_path.join(DEFAULT_LOCAL_DATA) if !root_path.nil?
if opts[:local_data_path]
@local_data_path = Pathname.new(File.expand_path(opts[:local_data_path], @cwd))
end
@logger.debug("Effective local data path: #{@local_data_path}")
# If we have a root path, load the ".vagrantplugins" file.
if root_path