From 0c435e2e082a14dece54e028e2aa1a37d070348d Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Mon, 2 May 2022 23:43:51 -0400 Subject: [PATCH] communicator/ssh: Fix crash using SSH+HTTP proxy --- internal/communicator/ssh/communicator.go | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/communicator/ssh/communicator.go b/internal/communicator/ssh/communicator.go index 6200f4fa59..c6af68839e 100644 --- a/internal/communicator/ssh/communicator.go +++ b/internal/communicator/ssh/communicator.go @@ -170,20 +170,20 @@ func (c *Communicator) Connect(o provisioners.UIOutput) (err error) { c.connInfo.BastionHostKey != "", )) } - } - if c.connInfo.ProxyHost != "" { - o.Output(fmt.Sprintf( - "Using configured proxy host...\n"+ - " ProxyHost: %s\n"+ - " ProxyPort: %d\n"+ - " ProxyUserName: %s\n"+ - " ProxyUserPassword: %t", - c.connInfo.ProxyHost, - c.connInfo.ProxyPort, - c.connInfo.ProxyUserName, - c.connInfo.ProxyUserPassword != "", - )) + if c.connInfo.ProxyHost != "" { + o.Output(fmt.Sprintf( + "Using configured proxy host...\n"+ + " ProxyHost: %s\n"+ + " ProxyPort: %d\n"+ + " ProxyUserName: %s\n"+ + " ProxyUserPassword: %t", + c.connInfo.ProxyHost, + c.connInfo.ProxyPort, + c.connInfo.ProxyUserName, + c.connInfo.ProxyUserPassword != "", + )) + } } hostAndPort := fmt.Sprintf("%s:%d", c.connInfo.Host, c.connInfo.Port)