Revert the check for duplicate Vagrantfiles.
This is just tricky with case sensitive/insensitive file systems. Reverting since it doesn't seem worth it.
This commit is contained in:
parent
4f30a834d0
commit
ef37f692bd
|
@ -478,32 +478,15 @@ module Vagrant
|
|||
|
||||
# Finds the Vagrantfile in the given directory.
|
||||
#
|
||||
# This will raise an error if multiple matching Vagrantfiles are found.
|
||||
# This can only occur on case sensitive file systems, but if there is a
|
||||
# `Vagrantfile` and a `vagrantfile` it is not clear which Vagrant will
|
||||
# load, so an error must be raised.
|
||||
#
|
||||
# @param [Pathname] path Path to search in.
|
||||
# @return [Pathname]
|
||||
def find_vagrantfile(search_path)
|
||||
path = nil
|
||||
@vagrantfile_name.each do |vagrantfile|
|
||||
current_path = search_path.join(vagrantfile)
|
||||
|
||||
# If the path exists, then we verify we haven't found a match before,
|
||||
# then we set the path we've found.
|
||||
if current_path.exist?
|
||||
# We also test if current_path == path because on case insensitive
|
||||
# file systems, it will look like multiple exist.
|
||||
if path && current_path != path
|
||||
raise Errors::MultiVagrantfileFound, :directory => search_path.to_s
|
||||
return current_path if current_path.exist?
|
||||
end
|
||||
|
||||
path = current_path
|
||||
end
|
||||
end
|
||||
|
||||
path
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -193,11 +193,6 @@ module Vagrant
|
|||
error_key(:port_collision_resume)
|
||||
end
|
||||
|
||||
class MultiVagrantfileFound < VagrantError
|
||||
status_code(67)
|
||||
error_key(:multi_vagrantfile_found)
|
||||
end
|
||||
|
||||
class MultiVMEnvironmentRequired < VagrantError
|
||||
status_code(5)
|
||||
error_key(:multi_vm_required)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'rbconfig'
|
||||
require 'tempfile'
|
||||
|
||||
module Vagrant
|
||||
module Util
|
||||
|
|
|
@ -64,14 +64,8 @@ en:
|
|||
directory that Vagrant uses must be both readable and writable.
|
||||
|
||||
You specified: %{home_path}
|
||||
interrupted: "Vagrant exited after cleanup due to external interrupt."
|
||||
multi_vagrantfile_found: |-
|
||||
Multiple Vagrantfiles were found in the following directory. This usually
|
||||
occurs when multiple Vagrantfiles with different casing are found. For
|
||||
example: Vagrantfile and vagrantfile. Because the behavior in this case
|
||||
is undefined, please fix it so that there is only one matching Vagrantfile.
|
||||
|
||||
%{directory}
|
||||
interrupted: |-
|
||||
Vagrant exited after cleanup due to external interrupt.
|
||||
multi_vm_required: |-
|
||||
A multi-vm environment is required for name specification to this command.
|
||||
multi_vm_target_required: |-
|
||||
|
|
|
@ -151,26 +151,6 @@ VF
|
|||
env = environment.create_vagrant_env
|
||||
env.config.for_vm(:default).ssh.port.should == 100
|
||||
end
|
||||
|
||||
it "should error if the box has an ambiguous Vagrantfile" do
|
||||
environment = isolated_environment do |env|
|
||||
env.vagrantfile(<<-VF)
|
||||
Vagrant::Config.run do |config|
|
||||
config.vm.box = "base"
|
||||
end
|
||||
VF
|
||||
|
||||
# Create two Vagrantfiles. The normal one and a Vagrantfile2
|
||||
box_dir = env.box("base", "")
|
||||
box_dir.join("Vagrantfile2").open("w") do |f|
|
||||
f.write("")
|
||||
end
|
||||
end
|
||||
|
||||
env = environment.create_vagrant_env(:vagrantfile_name => ["Vagrantfile", "Vagrantfile2"])
|
||||
expect { env.config }.
|
||||
to raise_error(Vagrant::Errors::MultiVagrantfileFound)
|
||||
end
|
||||
end
|
||||
|
||||
describe "ui" do
|
||||
|
|
Loading…
Reference in New Issue