diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index 1e356f41f..3f8e419b3 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -911,19 +911,21 @@ module VagrantPlugins duplicate_names = disk_names.find_all { |d| disk_names.count(d) > 1 } if duplicate_names.any? errors << I18n.t("vagrant.config.vm.multiple_disk_names_error", - names: duplicate_names.uniq.join("\n")) + name: machine.name, + disk_names: duplicate_names.uniq.join("\n")) end disk_files = @disks.map { |d| d.file } duplicate_files = disk_files.find_all { |d| d && disk_files.count(d) > 1 } if duplicate_files.any? errors << I18n.t("vagrant.config.vm.multiple_disk_files_error", - files: duplicate_files.uniq.join("\n")) + name: machine.name, + disk_files: duplicate_files.uniq.join("\n")) end @disks.each do |d| error = d.validate(machine) - errors.concat error if !error.empty? + errors.concat(error) if !error.empty? end # Validate clout_init_configs diff --git a/templates/locales/en.yml b/templates/locales/en.yml index eac32d5be..7ba660ea8 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -1996,16 +1996,16 @@ en: There are more than one primary disks defined for guest '%{name}'. Please ensure that only one disk has been defined as a primary disk. multiple_disk_files_error: |- The following disk files are used multiple times in the disk - configuration: + configuration for the VM '%{name}': - %{files} + %{disk_files} Each disk file may only be attached to a VM once. multiple_disk_names_error: |- The following disks names are defined multiple times in the disk - configuration: + configuration for the VM '%{name}': - %{names} + %{disk_names} Disk names must be unique. multiple_networks_set_hostname: "Multiple networks have set `:hostname`" @@ -2267,7 +2267,6 @@ en: configure_disks: start: "Configuring storage mediums..." floppy_not_supported: "Floppy disk configuration not yet supported. Skipping disk '%{name}'..." - dvd_not_supported: "DVD disk configuration not yet supported. Skipping disk '%{name}'..." shrink_size_not_supported: |- VirtualBox does not support shrinking disk sizes. Cannot shrink '%{name}' disks size. create_disk: |- diff --git a/test/unit/plugins/kernel_v2/config/vm_test.rb b/test/unit/plugins/kernel_v2/config/vm_test.rb index cf41addcb..914d3c74f 100644 --- a/test/unit/plugins/kernel_v2/config/vm_test.rb +++ b/test/unit/plugins/kernel_v2/config/vm_test.rb @@ -8,7 +8,7 @@ describe VagrantPlugins::Kernel_V2::VMConfig do subject { described_class.new } let(:provider) { double("provider") } - let(:machine) { double("machine", provider: provider, provider_name: "provider") } + let(:machine) { double("machine", provider: provider, provider_name: "provider", name: "default") } def assert_invalid errors = subject.validate(machine)