From abddc4889bee6f20996c7869aa845645ee3b9477 Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Thu, 18 Nov 2021 19:08:36 +0200 Subject: [PATCH] fixes https://github.com/ratt-ru/radiopadre/issues/113 some more --- iglesia/__init__.py | 5 +++-- radiopadre_client/backends/venv.py | 2 +- radiopadre_client/remote.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iglesia/__init__.py b/iglesia/__init__.py index 7fdc8cb..37ee1ee 100644 --- a/iglesia/__init__.py +++ b/iglesia/__init__.py @@ -182,14 +182,15 @@ def set_userside_ports(userside_ports): global JUPYTER_PORT, JS9HELPER_PORT, HTTPSERVER_PORT, CARTA_PORT, CARTA_WS_PORT, WETTY_PORT JUPYTER_PORT, JS9HELPER_PORT, HTTPSERVER_PORT, CARTA_PORT, CARTA_WS_PORT, WETTY_PORT = userside_ports -def get_carta_url(*args): +def get_carta_url(session_id, *args): url = f"http://localhost:{CARTA_PORT}" args = list(args) if CARTA_VERSION < "2": args = [f"socketUrl=ws://localhost:{CARTA_WS_PORT}"] + args else: - args = [f"token={uuid.UUID(SESSION_ID)}"] + args + token = str(uuid.UUID(session_id)) + args = [f"token={token}"] + args if args: return f"{url}?{'&'.join(args)}" diff --git a/radiopadre_client/backends/venv.py b/radiopadre_client/backends/venv.py index 65ce2be..308cf08 100644 --- a/radiopadre_client/backends/venv.py +++ b/radiopadre_client/backends/venv.py @@ -180,7 +180,7 @@ def start_session(container_name, selected_ports, userside_ports, notebook_path, # add CARTA URL, if configured if config.CARTA_BROWSER and iglesia.CARTA_VERSION: if type(browser_urls) is list: - browser_urls.append(iglesia.get_carta_url()) + browser_urls.append(iglesia.get_carta_url(session_id=config.SESSION_ID)) ## start jupyter process jupyter_path = config.RADIOPADRE_VENV + "/bin/jupyter" diff --git a/radiopadre_client/remote.py b/radiopadre_client/remote.py index 2061e01..83ba0dc 100644 --- a/radiopadre_client/remote.py +++ b/radiopadre_client/remote.py @@ -423,7 +423,7 @@ def check_remote_command(command): if match: iglesia.CARTA_VERSION = match.group(1) if config.CARTA_BROWSER: - urls.append(iglesia.get_carta_url()) + urls.append(iglesia.get_carta_url(session_id=config.SESSION_ID)) message(f"Remote CARTA version is {iglesia.CARTA_VERSION} ({config.CARTA_BROWSER})") continue