Add locale for primary disk validation error

This commit is contained in:
Brian Cain 2019-11-13 15:44:52 -08:00
parent f51805e910
commit 7feee7a87f
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
2 changed files with 6 additions and 2 deletions

View File

@ -806,8 +806,10 @@ module VagrantPlugins
# Validate disks
# Check if there is more than one primrary disk defined and throw an error
if @disks.select { |d| d.primary && d.type == :disk }.size > 1
errors << "There is more than one disk defined for guest '#{machine.name}'. Please pick a `primary` disk."
primary_disks = @disks.select { |d| d.primary && d.type == :disk }
if primary_disks.size > 1
errors << I18n.t("vagrant.config.vm.multiple_primary_disks_error",
name: machine.name)
end
# TODO: Check for duplicate disk names?

View File

@ -1892,6 +1892,8 @@ en:
hyphens or dots. It cannot start with a hyphen or dot.
ignore_provider_config: |-
Ignoring provider config for validation...
multiple_primary_disks_error: |-
There are more than one primary disks defined for guest '%{name}'. Please ensure that only one disk has been defined as a primary disk.
name_invalid: |-
The sub-VM name '%{name}' is invalid. Please don't use special characters.
network_ip_ends_in_one: |-