From 9b59c2fadb1ebd5a9d7962b4f3a3e3112b69edd3 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 6 Feb 2025 13:25:39 -0500 Subject: [PATCH] Have httpapi support multiple shell sessions --- confluent_server/confluent/httpapi.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/httpapi.py b/confluent_server/confluent/httpapi.py index e2144235..2fbc700b 100644 --- a/confluent_server/confluent/httpapi.py +++ b/confluent_server/confluent/httpapi.py @@ -527,7 +527,11 @@ def wsock_handler(ws): else: delimit = '/shell/sessions' shellsession = True - node = targ.split(delimit, 1)[0] + nodesess = targ.split(delimit, 1) + node = nodesess[0] + sessidx = None + if len(nodesess) == 2 and len(nodesess[1]) > 1: + sessidx = nodesess[1][1:] node = node.rsplit('/', 1)[-1] auditmsg = {'operation': 'start', 'target': targ, 'user': util.stringify(username)} @@ -538,7 +542,7 @@ def wsock_handler(ws): node=node, configmanager=cfgmgr, username=username, skipreplay=skipreplay, datacallback=datacallback, - width=width, height=height) + width=width, height=height, sessionid=sessidx) else: consession = consoleserver.ConsoleSession( node=node, configmanager=cfgmgr,