communicator/ssh: Fix crash using SSH+HTTP proxy

This commit is contained in:
Alisdair McDiarmid 2022-05-02 23:43:51 -04:00
parent 80792312d8
commit 0c435e2e08

View File

@ -170,7 +170,6 @@ func (c *Communicator) Connect(o provisioners.UIOutput) (err error) {
c.connInfo.BastionHostKey != "", c.connInfo.BastionHostKey != "",
)) ))
} }
}
if c.connInfo.ProxyHost != "" { if c.connInfo.ProxyHost != "" {
o.Output(fmt.Sprintf( o.Output(fmt.Sprintf(
@ -185,6 +184,7 @@ func (c *Communicator) Connect(o provisioners.UIOutput) (err error) {
c.connInfo.ProxyUserPassword != "", c.connInfo.ProxyUserPassword != "",
)) ))
} }
}
hostAndPort := fmt.Sprintf("%s:%d", c.connInfo.Host, c.connInfo.Port) hostAndPort := fmt.Sprintf("%s:%d", c.connInfo.Host, c.connInfo.Port)
log.Printf("[DEBUG] Connecting to %s for SSH", hostAndPort) log.Printf("[DEBUG] Connecting to %s for SSH", hostAndPort)