From 419498cae6e019494be19384d36fa7f1fafbd040 Mon Sep 17 00:00:00 2001 From: Cole Deck Date: Tue, 6 Aug 2024 17:26:12 -0500 Subject: [PATCH] Include stderr --- run.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/run.py b/run.py index 2306b1c..4c56d61 100755 --- a/run.py +++ b/run.py @@ -1118,34 +1118,36 @@ def setup_client(pool): fprint("VM online.") # Windows client setup - from subprocess import PIPE fprint("Running full jukebox control system...") - jb = subprocess.Popen("ssh root@192.168.1.25 -- /root/jukebox-software/run.sh".split(' '), stdout=PIPE, stderr=PIPE, bufsize=1, universal_newlines=True) + jb = subprocess.Popen("ssh root@192.168.1.25 -- /root/jukebox-software/run.sh".split(' '), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1, universal_newlines=True) for line in jb.stdout: print(line, end='') if line.find("Running mode: Idle") > 0: # Jukebox started break # continue with program - - fprint("Opening browser...") - firefox = webdriver.Firefox() - firefox.fullscreen_window() + if jb.poll() is None: + + fprint("Opening browser...") + + firefox = webdriver.Firefox() + firefox.fullscreen_window() # firefox.get('http://localhost:7000') - firefox.get('http://192.168.1.25:3000') - global kill_ssh - for line in jb.stdout: - print(line, end='') - if kill_ssh is True: - break + firefox.get('http://192.168.1.25:3000') + global kill_ssh + for line in jb.stdout: + print(line, end='') + if kill_ssh is True: + break + - firefox.close() + firefox.close() jb.terminate() - run_cmd("Stop-VM -Name Jukebox*") + #run_cmd("Stop-VM -Name Jukebox*") killall() #firefox.execute_script('document.body.style.MozTransform = "scale(0.80)";') @@ -1198,8 +1200,8 @@ def killall(): def killall_signal(a, b): global config - if config["core"]["server"] == "Hyper-V": - run_cmd("Stop-VM -Name Jukebox*") # any and all VMs starting with "Jukebox" + #if config["core"]["server"] == "Hyper-V": + #run_cmd("Stop-VM -Name Jukebox*") # any and all VMs starting with "Jukebox" if config["core"]["mode"] == "winclient": global kill_ssh kill_ssh = True