From efd67e6c9d00c11353e30f195d3c79a7e0cdac5b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 17 May 2014 13:14:07 -0700 Subject: [PATCH] providers/docker: retry container ssh command [GH-3763] --- CHANGELOG.md | 2 ++ plugins/providers/docker/communicator.rb | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b767c655a..b1d1f2139 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ BUG FIXES: crash. [GH-3827] - providers/docker: Never do graceful shutdown, always use `docker stop`. [GH-3798] + - providers/docker: Better error messaging when SSH is not ready + direct to container. [GH-3763] - provisioners/puppet: Fix setting facter vars with Windows guests. [GH-3776] - guests/darwin: Respect mount options for NFS. [GH-3791] diff --git a/plugins/providers/docker/communicator.rb b/plugins/providers/docker/communicator.rb index acf48e6b2..285e3eb82 100644 --- a/plugins/providers/docker/communicator.rb +++ b/plugins/providers/docker/communicator.rb @@ -25,7 +25,9 @@ module VagrantPlugins return false if !@host_vm.communicate.ready? # We're ready if we can establish an SSH connection to the container - @host_vm.communicate.test("#{container_ssh_command} exit") + command = container_ssh_command + return false if !command + @host_vm.communicate.test("#{command} exit") end def download(from, to) @@ -131,6 +133,7 @@ module VagrantPlugins def container_ssh_command # Get the container's SSH info info = @machine.ssh_info + return nil if !info info[:port] ||= 22 # Make sure our private keys are synced over to the host VM