communicators/ssh: only show warnings after a few attempts [GH-3442]
This commit is contained in:
parent
3aad85fa30
commit
77c92d0d11
|
@ -18,6 +18,8 @@ BUG FIXES:
|
||||||
- commands/package: Nice error if includes contain symlinks. [GH-3200]
|
- commands/package: Nice error if includes contain symlinks. [GH-3200]
|
||||||
- commands/rsync-auto: Don't crash if the machine can't be communicated
|
- commands/rsync-auto: Don't crash if the machine can't be communicated
|
||||||
to. [GH-3419]
|
to. [GH-3419]
|
||||||
|
- communicators/ssh: Only show connection warnings after three connection
|
||||||
|
attempt failures. [GH-3442]
|
||||||
- guests/coreos: Docker provisioner works. [GH-3425]
|
- guests/coreos: Docker provisioner works. [GH-3425]
|
||||||
- guests/fedora: Fix hostname setting. [GH-3382]
|
- guests/fedora: Fix hostname setting. [GH-3382]
|
||||||
- guests/fedora: Support predictable network interface names for
|
- guests/fedora: Support predictable network interface names for
|
||||||
|
|
|
@ -52,8 +52,10 @@ module VagrantPlugins
|
||||||
ssh_auth_type = "password" if ssh_info[:password]
|
ssh_auth_type = "password" if ssh_info[:password]
|
||||||
@machine.ui.detail("SSH auth method: #{ssh_auth_type}")
|
@machine.ui.detail("SSH auth method: #{ssh_auth_type}")
|
||||||
|
|
||||||
|
attempts = 0
|
||||||
while true
|
while true
|
||||||
message = nil
|
attempts +=1
|
||||||
|
message = nil
|
||||||
begin
|
begin
|
||||||
begin
|
begin
|
||||||
connect(retries: 1)
|
connect(retries: 1)
|
||||||
|
@ -82,7 +84,9 @@ module VagrantPlugins
|
||||||
# Ignore it, SSH is not ready, some other error.
|
# Ignore it, SSH is not ready, some other error.
|
||||||
end
|
end
|
||||||
|
|
||||||
if message
|
# Start showing warning messages after the 3rd attempt, since
|
||||||
|
# the first couple are usually just waiting for actual booting.
|
||||||
|
if message && attempts >= 3
|
||||||
@machine.ui.detail("Warning: #{message} Retrying...")
|
@machine.ui.detail("Warning: #{message} Retrying...")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue