diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index 906b8d9bc..82f8a5e24 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -248,6 +248,10 @@ module Vagrant error_key(:bundler_error) end + class CantReadMACAddresses < VagrantError + error_key(:cant_read_mac_addresses) + end + class CapabilityHostExplicitNotDetected < VagrantError error_key(:capability_host_explicit_not_detected) end diff --git a/plugins/guests/darwin/cap/configure_networks.rb b/plugins/guests/darwin/cap/configure_networks.rb index 1f43acd6a..1be71c82f 100644 --- a/plugins/guests/darwin/cap/configure_networks.rb +++ b/plugins/guests/darwin/cap/configure_networks.rb @@ -12,7 +12,7 @@ module VagrantPlugins def self.configure_networks(machine, networks) if !machine.provider.capability?(:nic_mac_addresses) - raise Errors::CantReadMACAddresses, + raise Vagrant::Errors::CantReadMACAddresses, provider: machine.provider_name.to_s end diff --git a/plugins/guests/windows/cap/configure_networks.rb b/plugins/guests/windows/cap/configure_networks.rb index 8e766a319..a4f4685d9 100644 --- a/plugins/guests/windows/cap/configure_networks.rb +++ b/plugins/guests/windows/cap/configure_networks.rb @@ -53,7 +53,7 @@ module VagrantPlugins def self.create_vm_interface_map(machine, guest_network) if !machine.provider.capability?(:nic_mac_addresses) - raise Errors::CantReadMACAddresses, + raise Vagrant::Errors::CantReadMACAddresses, provider: machine.provider_name.to_s end diff --git a/plugins/guests/windows/errors.rb b/plugins/guests/windows/errors.rb index d5be14ce6..e76753646 100644 --- a/plugins/guests/windows/errors.rb +++ b/plugins/guests/windows/errors.rb @@ -6,10 +6,6 @@ module VagrantPlugins error_namespace("vagrant_windows.errors") end - class CantReadMACAddresses < WindowsError - error_key(:cant_read_mac_addresses) - end - class NetworkWinRMRequired < WindowsError error_key(:network_winrm_required) end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 9e8c680aa..94f47371d 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -606,6 +606,14 @@ en: issues. The error from Bundler is: %{message} + cant_read_mac_addresses: |- + The provider you are using ('%{provider}') doesn't support the + "nic_mac_addresses" provider capability which is required + for advanced networking to work with this guest OS. Please inform + the author of the provider to add this feature. + + Until then, you must remove any networking configurations other + than forwarded ports from your Vagrantfile for Vagrant to continue. capability_host_explicit_not_detected: |- The explicit capability host specified of '%{value}' could not be found. diff --git a/templates/locales/guest_windows.yml b/templates/locales/guest_windows.yml index a648f5a09..f9a3bf997 100644 --- a/templates/locales/guest_windows.yml +++ b/templates/locales/guest_windows.yml @@ -1,14 +1,6 @@ en: vagrant_windows: errors: - cant_read_mac_addresses: |- - The provider being used to start Windows ('%{provider}') - doesn't support the "nic_mac_addresses" capability which is required - for advanced networking to work with Windows guests. Please inform - the author of the provider to add this feature. - - Until then, you must remove any networking configurations other - than forwarded ports from your Vagrantfile for Vagrant to continue. network_winrm_required: |- Configuring networks on Windows requires the communicator to be set to WinRM. To do this, add the following to your Vagrantfile: