Move "cant_read_mac_addresses" error to the global space

Now it is used not only by Windows, but by Darwin guests as well.
This commit is contained in:
Mikhail Zholobov 2015-10-09 14:56:18 +03:00
parent e426455309
commit f930fa94af
6 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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: