Include stderr

This commit is contained in:
Cole Deck 2024-08-06 17:26:12 -05:00
parent c89fc86812
commit 419498cae6

34
run.py
View File

@ -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