ssh: Fix deadlock on agent forwarding error

If there is an error when opening the session for agent forwarding in
the process ssh connention, there is a deadlock when recursively
calling Connect on an internal reattempt. Avoid that, and let the
connection be reattempted externally.
This commit is contained in:
Jaime Caamaño Ruiz 2019-12-12 18:16:17 +01:00
parent bfbd00a23c
commit c3a61a040e
1 changed files with 1 additions and 1 deletions

View File

@ -206,7 +206,7 @@ func (c *Communicator) Connect(o terraform.UIOutput) (err error) {
}
log.Printf("[DEBUG] Setting up a session to request agent forwarding")
session, err := c.newSession()
session, err := c.client.NewSession()
if err != nil {
return err
}