fixed service login/logout

This commit is contained in:
Adolfo Gómez 2020-02-11 14:43:10 +01:00
parent b0d4be83a4
commit 903ccf2e0a
2 changed files with 6 additions and 2 deletions

View File

@ -260,7 +260,9 @@ class CommonService: # pylint: disable=too-many-instance-attributes
)
# On first successfull initialization request, master token will dissapear for managed hosts so it will be no more available (not needed anyway)
platform.store.writeConfig(self._cfg)
if self.isManaged():
platform.store.writeConfig(self._cfg)
# Setup logger now
if self._cfg.own_token:
logger.setRemoteLogger(self._api, self._cfg.own_token)
@ -387,6 +389,8 @@ class CommonService: # pylint: disable=too-many-instance-attributes
self._api.logout(self._cfg.own_token, username)
self.onLogout(username)
self._cfg = self._cfg._replace(own_token=None)
# ****************************************
# Methods that CAN BE overriden by actors
# ****************************************

View File

@ -72,8 +72,8 @@ class SensLogon(win32com.server.policy.DesignatedWrapPolicy):
self._service = service
def Logon(self, *args):
logger.debug('Logon event: {}'.format(args))
self._service.login(args[0] or '')
logger.debug('Logon event: {}'.format(args))
def Logoff(self, *args):
logger.debug('Logoff event: arguments: {}'.format(args))