2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-04-19 03:27:20 +00:00

Use a plain incrementing session id

UUIDs when a simple number will do are harder to use.
Change to a simple increment id.  This could cause an issue
with multiple management nodes, but I think the sessions
should be contained to the instance used.
This commit is contained in:
Jarrod Johnson 2016-01-06 11:40:31 -05:00
parent 5695bf5288
commit 23f025eb71

View File

@ -88,10 +88,13 @@ class ShellSession(consoleserver.ConsoleSession):
def connect_session(self):
global activesessions
tenant = self.configmanager.tenant
if self.sessionid is None:
self.sessionid = str(uuid.uuid4())
if (self.configmanager.tenant, self.node) not in activesessions:
activesessions[(tenant, self.node)] = {}
if self.sessionid is None:
self.sessionid = 1
while str(self.sessionid) in activesessions[(tenant, self.node)]:
self.sessionid += 1
self.sessionid = str(self.sessionid)
if self.sessionid not in activesessions[(tenant, self.node)]:
activesessions[(tenant, self.node)][self.sessionid] = _ShellHandler(self.node, self.configmanager)
self.conshdl = activesessions[(self.configmanager.tenant, self.node)][self.sessionid]