From 138018c8968cfc88c70d95f7bbf43f729279d35d Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Fri, 10 Jul 2015 12:51:45 -0600 Subject: [PATCH] communicator/ssh: agent forward failure is not fatal On connections where no second hop is made, there's no problem if the agent forwarding connection is denied, so we shouldn't treat that as a fatal error. --- communicator/ssh/communicator.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index 672dc78af..6e638d7d7 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -136,11 +136,13 @@ func (c *Communicator) Connect(o terraform.UIOutput) (err error) { } defer session.Close() - if err = agent.RequestAgentForwarding(session); err != nil { - return err - } + err = agent.RequestAgentForwarding(session) - log.Printf("[INFO] agent forwarding enabled") + if err == nil { + log.Printf("[INFO] agent forwarding enabled") + } else { + log.Printf("[WARN] error forwarding agent: %s", err) + } } if o != nil {