Rescue the EHOSTDOWN error for SSH
This commit is contained in:
parent
0fd5152db4
commit
22571bf05b
|
@ -374,6 +374,10 @@ module Vagrant
|
|||
error_key(:ssh_disconnected)
|
||||
end
|
||||
|
||||
class SSHHostDown < VagrantError
|
||||
error_key(:ssh_host_down)
|
||||
end
|
||||
|
||||
class SSHKeyBadPermissions < VagrantError
|
||||
status_code(12)
|
||||
error_key(:ssh_key_bad_permissions)
|
||||
|
|
|
@ -184,6 +184,9 @@ module VagrantPlugins
|
|||
rescue Errno::ECONNREFUSED
|
||||
# This is raised if we failed to connect the max amount of times
|
||||
raise Vagrant::Errors::SSHConnectionRefused
|
||||
rescue Errno::EHOSTDOWN
|
||||
# This is raised if we get an ICMP DestinationUnknown error.
|
||||
raise Vagrant::Errors::SSHHostDown
|
||||
rescue NotImplementedError
|
||||
# This is raised if a private key type that Net-SSH doesn't support
|
||||
# is used. Show a nicer error.
|
||||
|
|
|
@ -201,6 +201,10 @@ en:
|
|||
usually indicates that SSH within the guest machine was unable to
|
||||
properly start up. Please boot the VM in GUI mode to check whether
|
||||
it is booting properly.
|
||||
ssh_host_down: |-
|
||||
While attempting to connect with SSH, a "host is down" (EHOSTDOWN)
|
||||
error was received. Please verify your SSH settings are correct
|
||||
and try again.
|
||||
ssh_key_bad_permissions: |-
|
||||
The private key to connect to this box via SSH has invalid permissions
|
||||
set on it. The permissions of the private key should be set to 0600, otherwise SSH will
|
||||
|
|
Loading…
Reference in New Issue