Merge pull request #9685 from briancain/improve-hostonly-conf-error

Improve network collision error message
This commit is contained in:
Brian Cain 2018-04-12 15:18:50 -07:00 committed by GitHub
commit 42df3e7185
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -280,8 +280,12 @@ module VagrantPlugins
# interface. # interface.
@env[:machine].provider.driver.read_bridged_interfaces.each do |interface| @env[:machine].provider.driver.read_bridged_interfaces.each do |interface|
that_netaddr = network_address(interface[:ip], interface[:netmask]) that_netaddr = network_address(interface[:ip], interface[:netmask])
raise Vagrant::Errors::NetworkCollision if \ if netaddr == that_netaddr && interface[:status] != "Down"
netaddr == that_netaddr && interface[:status] != "Down" raise Vagrant::Errors::NetworkCollision,
netaddr: netaddr,
that_netaddr: that_netaddr,
interface_name: interface[:name]
end
end end
# Split the IP address into its components # Split the IP address into its components

View File

@ -2076,6 +2076,9 @@ en:
This will cause your specified IP to be inaccessible. Please change This will cause your specified IP to be inaccessible. Please change
the IP or name of your host only network so that it no longer matches that of the IP or name of your host only network so that it no longer matches that of
a bridged or non-hostonly network. a bridged or non-hostonly network.
Bridged Network Address: '%{netaddr}'
Host-only Network '%{interface_name}': '%{that_netaddr}'
creating: "Creating new host only network for environment..." creating: "Creating new host only network for environment..."
enabling: "Enabling host only network..." enabling: "Enabling host only network..."
not_found: |- not_found: |-