fixed for usersession

This commit is contained in:
Adolfo Gómez García 2022-08-07 13:32:07 +02:00
parent 78a3216b51
commit 01f9a1f9cd
2 changed files with 5 additions and 5 deletions

View File

@ -473,7 +473,7 @@ class CommonService: # pylint: disable=too-many-instance-attributes
# Now check if every registered client is already there (if logged in OFC)
for lost_client in clients_pool.UDSActorClientPool().lost_clients():
logger.info('Lost client: {}'.format(lost_client))
self.logout('client_unavailable', '', lost_client.session_id or '')
self.logout('client_unavailable', '', lost_client.session_id or '') # '' means "all clients"
except Exception as e:
logger.error('Exception on main service loop: %s', e)
@ -554,14 +554,14 @@ class CommonService: # pylint: disable=too-many-instance-attributes
self._interfaces,
self._secret,
)
!= 'ok'
!= 'ok' # Can return also "notified", that means the logout has not been processed by UDS
):
logger.info(
'Logout from %s ignored as required by uds broker', username
)
return
self.onLogout(username)
self.onLogout(username, session_id or '')
if not self.isManaged():
self.uninitialize()
@ -609,5 +609,5 @@ class CommonService: # pylint: disable=too-many-instance-attributes
return 'ok'
def onLogout(self, userName: str) -> None:
def onLogout(self, userName: str, session_id: str) -> None:
logger.debug('On logout invoked for {}'.format(userName))

View File

@ -183,7 +183,7 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
operations.writeToPipe("\\\\.\\pipe\\VDSMDPipe", packet, True)
return 'done'
def onLogout(self, userName) -> None:
def onLogout(self, userName: str, session_id: str) -> None:
logger.debug('Windows onLogout invoked: {}, {}'.format(userName, self._user))
try:
p = win32security.GetBinarySid(REMOTE_USERS_SID)