only add tunnel to list if it gets set up

This commit is contained in:
Jordan Rodgers 2018-02-12 23:30:44 -05:00
parent 545ca65930
commit 63fd8c3e2f

View file

@ -200,9 +200,9 @@ def vm_console(vmid):
print("Creating SSH tunnel to {} for VM {}.".format(node, vmid))
try:
tunnel = start_ssh_tunnel(node, port)
ssh_tunnels.append(tunnel)
except:
print('SSH tunnel already exists.')
ssh_tunnels.append(tunnel)
start_vm_vnc(proxmox, vmid)
return token, 200
else: