improve FrappyManager.get_server_state
look at frappy server cfg when sea and frappy cfg are both unrelated
This commit is contained in:
11
frappyman.py
11
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
|
||||
|
||||
Reference in New Issue
Block a user