mirror of
https://github.com/letic/terraform-provider-proxmox.git
synced 2024-09-28 22:16:03 +00:00
restore ssh port option for ssh_forward
This commit is contained in:
parent
baf8df69f7
commit
23e407d44c
@ -290,8 +290,8 @@ func resourceVmQemu() *schema.Resource {
|
||||
},
|
||||
},
|
||||
"serial": &schema.Schema{
|
||||
Type: schema.TypeSet,
|
||||
Optional: true,
|
||||
Type: schema.TypeSet,
|
||||
Optional: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"id": &schema.Schema{
|
||||
@ -782,9 +782,9 @@ func diskSizeGB(dcSize interface{}) float64 {
|
||||
diskString := strings.ToUpper(dcSize.(string))
|
||||
re := regexp.MustCompile("([0-9]+)([A-Z]*)")
|
||||
diskArray := re.FindStringSubmatch(diskString)
|
||||
|
||||
|
||||
diskSize, _ = strconv.ParseFloat(diskArray[1], 64)
|
||||
|
||||
|
||||
if len(diskArray) >= 3 {
|
||||
switch diskArray[2] {
|
||||
case "G", "GB":
|
||||
@ -903,6 +903,12 @@ func initConnInfo(
|
||||
ipMatch := rxIPconfig.FindStringSubmatch(d.Get("ipconfig0").(string))
|
||||
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 {
|
||||
log.Print("[DEBUG] setting up SSH forward")
|
||||
sshPort, err = pxapi.SshForwardUsernet(vmr, client)
|
||||
|
Loading…
Reference in New Issue
Block a user