From 2d303623012b1609a4cf6e3c3feb47de46d3a226 Mon Sep 17 00:00:00 2001 From: Alexander Burmatov Date: Wed, 17 May 2023 16:30:54 +0300 Subject: [PATCH] Saving actor config for non-persistent machines This is necessary to leave a non-persistent machine from the domain. --- actor/src/udsactor/service.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/actor/src/udsactor/service.py b/actor/src/udsactor/service.py index 12267943c..4ed636567 100644 --- a/actor/src/udsactor/service.py +++ b/actor/src/udsactor/service.py @@ -194,10 +194,15 @@ class CommonService: # pylint: disable=too-many-instance-attributes # Cleans sensible data if self._cfg.config: - self._cfg = self._cfg._replace( - config=self._cfg.config._replace(os=None), data=None - ) - platform.store.writeConfig(self._cfg) + try: + isPersistent = self._cfg.config.os.isPersistent == 'y' + except: + isPersistent = True + if isPersistent: + self._cfg = self._cfg._replace( + config=self._cfg.config._replace(os=None), data=None + ) + platform.store.writeConfig(self._cfg) logger.info('Service ready')