2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-10-20 14:45:45 +00:00

Fixup for closing vnc session

This commit is contained in:
Jarrod Johnson
2026-10-12 13:27:56 -04:00
parent 6d87d3e7a1
commit 3d805fa342
2 changed files with 15 additions and 2 deletions
@@ -185,6 +185,9 @@ class KvmConnection:
self.portnum = 8006
self.password = consdata['ticket']
def close(self):
pass
class KvmConnHandler:
def __init__(self, pmxclient, node):
+12 -2
View File
@@ -67,7 +67,12 @@ async def close_session(sessionid):
return
del _usersessions[sessionid]
nodename = sessioninfo['nodename']
wc = sessioninfo['webclient']
if 'cxnmgr' in sessioninfo:
await sessioninfo['cxnmgr'].close()
return
wc = sessioninfo.get('webclient')
if not wc:
return
cfg = configmanager.ConfigManager(None)
c = cfg.get_node_attributes(
nodename,
@@ -83,12 +88,17 @@ async def close_session(sessionid):
if not isinstance(bmcpass, str):
bmcpass = bmcpass.decode()
if bmcuser and bmcpass:
token = None
for cookie in wc.cookies:
if cookie.key.lower() == 'xsrf-token':
token = cookie.value
break
await wc.grab_json_response_with_status(
'/logout', {'data': [bmcuser, bmcpass]},
headers={
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-XSRF-TOKEN': wc.cookies['XSRF-TOKEN']})
'X-XSRF-TOKEN': token})
async def send_grant(conn, nodename, rqtype):