restore ssh port option for ssh_forward

This commit is contained in:
Grant Gongaware 2019-09-04 12:45:02 -07:00
parent baf8df69f7
commit 23e407d44c

View File

@ -903,6 +903,12 @@ func initConnInfo(
ipMatch := rxIPconfig.FindStringSubmatch(d.Get("ipconfig0").(string)) ipMatch := rxIPconfig.FindStringSubmatch(d.Get("ipconfig0").(string))
sshHost = ipMatch[1] sshHost = ipMatch[1]
} }
// Check if we got a speficied port
if strings.Contains(sshHost, ":") {
sshParts := strings.Split(sshHost, ":")
sshHost = sshParts[0]
sshPort = sshParts[1]
}
} else { } else {
log.Print("[DEBUG] setting up SSH forward") log.Print("[DEBUG] setting up SSH forward")
sshPort, err = pxapi.SshForwardUsernet(vmr, client) sshPort, err = pxapi.SshForwardUsernet(vmr, client)