From 63fd8c3e2f59efe5c4b0328e10e3904f6a13eb31 Mon Sep 17 00:00:00 2001 From: Jordan Rodgers Date: Mon, 12 Feb 2018 23:30:44 -0500 Subject: [PATCH] only add tunnel to list if it gets set up --- proxstar/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxstar/__init__.py b/proxstar/__init__.py index a7a4e03..31005ca 100644 --- a/proxstar/__init__.py +++ b/proxstar/__init__.py @@ -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: