From 4d9e0c757fd3db28829aad8f00d55b67cf2e7511 Mon Sep 17 00:00:00 2001 From: l_samenv Date: Mon, 10 Jun 2024 07:48:01 +0200 Subject: [PATCH] improve FrappyManager.get_server_state look at frappy server cfg when sea and frappy cfg are both unrelated --- frappyman.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frappyman.py b/frappyman.py index 18f7558..5fc2686 100644 --- a/frappyman.py +++ b/frappyman.py @@ -404,6 +404,7 @@ class FrappyManager(ServiceManager): if proposed_addons: # and set(proposed_addons) != set(running_addons): proposed_cfg['addons'] = {','.join(proposed_addons)} + self._debug = {} for service in FrappyManager.services: given = givencfgs.get(service) running = self.frappy_cfgs.get(service) @@ -412,7 +413,12 @@ class FrappyManager(ServiceManager): if running: self.state[f'frappy {service}'] = running - if seaconfig: # sea server is running + self._debug[service] = (seaconfig, available, running, running in self.frappy2sea) + + if seaconfig and (available or running in self.frappy2sea): + # we get here when the sea server is running and either at least one of: + # - the sea config is matching any frappy cfg + # - the running frappy cfg is matching a sea config if not available: self.remarks[service] = 'no frappy config' continue @@ -440,6 +446,9 @@ class FrappyManager(ServiceManager): else: result[service] = proposed else: + # we get here when sea is not running or all of: + # - the sea config has no matching frappy cfg + # - the frappy cfg has no matching sea config if running: if self.frappy2sea.get(running, '').endswith(ext): result[service] = running