diff --git a/actor/src/udsactor/service.py b/actor/src/udsactor/service.py index dfc3c263..dee88b4d 100644 --- a/actor/src/udsactor/service.py +++ b/actor/src/udsactor/service.py @@ -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 # **************************************** diff --git a/actor/src/udsactor/windows/SENS.py b/actor/src/udsactor/windows/SENS.py index 16d084b7..924e2762 100644 --- a/actor/src/udsactor/windows/SENS.py +++ b/actor/src/udsactor/windows/SENS.py @@ -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))