Show formatted error message with address and netmask

This commit is contained in:
Chris Roberts 2018-11-02 15:03:22 -07:00
parent d9d081199c
commit 5add5c24fe
2 changed files with 8 additions and 4 deletions

View File

@ -276,7 +276,8 @@ module VagrantPlugins
netaddr = IPAddr.new("#{options[:ip]}/#{options[:netmask]}") netaddr = IPAddr.new("#{options[:ip]}/#{options[:netmask]}")
rescue IPAddr::Error => e rescue IPAddr::Error => e
raise Vagrant::Errors::NetworkAddressInvalid, raise Vagrant::Errors::NetworkAddressInvalid,
options: options, error: e.message address: options[:ip], mask: options[:netmask],
error: e.message
end end
if ip.ipv4? if ip.ipv4?

View File

@ -972,10 +972,13 @@ en:
network_type_not_supported: |- network_type_not_supported: |-
The %{type} network type is not supported for this box or guest. The %{type} network type is not supported for this box or guest.
network_address_invalid: |- network_address_invalid: |-
Network settings specified in your Vagrantfile are invalid: Network settings specified in your Vagrantfile define an invalid
IP address. Please review the error message below and update your
Vagrantfile network settings:
Network settings: %{options} Address: %{address}
Error: %{error} Netmask: %{mask}
Error: %{error}
network_manager_not_installed: |- network_manager_not_installed: |-
Vagrant was instructed to configure the %{device} network device to Vagrant was instructed to configure the %{device} network device to
be managed by NetworkManager. However, the configured guest VM does be managed by NetworkManager. However, the configured guest VM does