kernel/v2: not an error if synced folder guest path is empty [GH-4833]
This commit is contained in:
parent
79115d1ccc
commit
f5e38a4a14
|
@ -603,16 +603,18 @@ module VagrantPlugins
|
||||||
guestpath = Pathname.new(options[:guestpath])
|
guestpath = Pathname.new(options[:guestpath])
|
||||||
hostpath = Pathname.new(options[:hostpath]).expand_path(machine.env.root_path)
|
hostpath = Pathname.new(options[:hostpath]).expand_path(machine.env.root_path)
|
||||||
|
|
||||||
if guestpath.relative? && guestpath.to_s !~ /^\w+:/
|
if guestpath.to_s != ""
|
||||||
errors << I18n.t("vagrant.config.vm.shared_folder_guestpath_relative",
|
if guestpath.relative? && guestpath.to_s !~ /^\w+:/
|
||||||
path: options[:guestpath])
|
errors << I18n.t("vagrant.config.vm.shared_folder_guestpath_relative",
|
||||||
else
|
|
||||||
if used_guest_paths.include?(options[:guestpath])
|
|
||||||
errors << I18n.t("vagrant.config.vm.shared_folder_guestpath_duplicate",
|
|
||||||
path: options[:guestpath])
|
path: options[:guestpath])
|
||||||
end
|
else
|
||||||
|
if used_guest_paths.include?(options[:guestpath])
|
||||||
|
errors << I18n.t("vagrant.config.vm.shared_folder_guestpath_duplicate",
|
||||||
|
path: options[:guestpath])
|
||||||
|
end
|
||||||
|
|
||||||
used_guest_paths.add(options[:guestpath])
|
used_guest_paths.add(options[:guestpath])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if !hostpath.directory? && !options[:create]
|
if !hostpath.directory? && !options[:create]
|
||||||
|
|
|
@ -480,6 +480,12 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
|
||||||
expect(sf["/vagrant"][:disabled]).to be_false
|
expect(sf["/vagrant"][:disabled]).to be_false
|
||||||
expect(sf["/vagrant"][:foo]).to eq(:bar)
|
expect(sf["/vagrant"][:foo]).to eq(:bar)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "is not an error if guest path is empty" do
|
||||||
|
subject.synced_folder(".", "")
|
||||||
|
subject.finalize!
|
||||||
|
assert_valid
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#usable_port_range" do
|
describe "#usable_port_range" do
|
||||||
|
|
Loading…
Reference in New Issue