diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index d12a11891..7852b39f2 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -662,7 +662,7 @@ module VagrantPlugins # Validate sub-VMs if there are any @__defined_vms.each do |name, _| - if name =~ /[\[\]\{\}]/ + if name =~ /[\[\]\{\}\/]/ errors["vm"] << I18n.t( "vagrant.config.vm.name_invalid", name: name) diff --git a/test/unit/plugins/kernel_v2/config/vm_test.rb b/test/unit/plugins/kernel_v2/config/vm_test.rb index 6b24ac47b..c9296a28f 100644 --- a/test/unit/plugins/kernel_v2/config/vm_test.rb +++ b/test/unit/plugins/kernel_v2/config/vm_test.rb @@ -132,6 +132,7 @@ describe VagrantPlugins::Kernel_V2::VMConfig do [ "foo [1]", "bar {2}", + "foo/bar", ].each do |name| it "should disallow names with brackets" do subject.define name