This commit is contained in:
Jordan Rodgers 2019-02-20 00:59:42 -05:00
parent 6a896c6dad
commit 01312a8452

View file

@ -21,7 +21,7 @@ def stop_websockify():
time.sleep(10) time.sleep(10)
if subprocess.run(['pgrep', 'websockify'], if subprocess.run(['pgrep', 'websockify'],
stdout=subprocess.PIPE).stdout: stdout=subprocess.PIPE).stdout:
logging.info('websockify didn\'t stop, killing forcefully.') logging.info('websockify didn\'t stop, killing forcefully')
subprocess.run(['kill', '-9', pid], stdout=subprocess.PIPE) subprocess.run(['kill', '-9', pid], stdout=subprocess.PIPE)
@ -86,7 +86,7 @@ def stop_ssh_tunnel(vmid, ssh_tunnels):
(tunnel for tunnel in ssh_tunnels if tunnel.local_bind_port == port), (tunnel for tunnel in ssh_tunnels if tunnel.local_bind_port == port),
None) None)
if tunnel: if tunnel:
logging.info("tearing down SSH tunnel for VM %s", vmid) logging.info('tearing down SSH tunnel for VM %s', vmid)
try: try:
tunnel.stop() tunnel.stop()
except: except: