From 5690aef4b06d2e96378ea60899609b5e2cf29d50 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 9 Apr 2013 19:05:35 -0700 Subject: [PATCH] Don't duplicate names when defining new machines in VFile --- CHANGELOG.md | 2 ++ plugins/kernel_v2/config/vm.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 229372082..314f1bb52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,8 @@ BUG FIXES: - `config.ssh` settings override all detected SSH settings (regression). [GH-1479] - `ssh-config` won't raise an exception if the VirtualBox machine is not created. [GH-1562] + - Multiple machines defined in the same Vagrantfile with the same + name will properly merge. ## 1.1.6 (April 3, 2013) diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index 32e4efeba..e1023ca15 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -172,7 +172,7 @@ module VagrantPlugins # Add the name to the array of VM keys. This array is used to # preserve the order in which VMs are defined. - @__defined_vm_keys << name + @__defined_vm_keys << name if !@__defined_vm_keys.include?(name) # Add the SubVM to the hash of defined VMs if !@__defined_vms[name]