fix summarize_server_state

This commit is contained in:
zolliker 2023-10-26 10:26:19 +02:00
parent 9839d4df0c
commit 49336a4f26

View File

@ -96,10 +96,6 @@ def summarize_server_state(givencfgs, ourcfgs, sealist, sea_info, strict=False):
seacfgfiles = [(c or '') + SEAEXT.get(s, '.addon') seacfgfiles = [(c or '') + SEAEXT.get(s, '.addon')
for c, s in zip_longest(sealist, FrappyManager.services)] for c, s in zip_longest(sealist, FrappyManager.services)]
seacfgset = set(seacfgfiles) seacfgset = set(seacfgfiles)
inverted_sea_info = {k: [] for k in seacfgfiles}
for cfg, seacfg in sea_info.items():
if seacfg in seacfgset:
inverted_sea_info[seacfg].append(cfg)
error = False error = False
result = {} result = {}
addons = set() addons = set()
@ -108,7 +104,7 @@ def summarize_server_state(givencfgs, ourcfgs, sealist, sea_info, strict=False):
for seacfg, seacfgfile, key in zip_longest(sealist, seacfgfiles, ('main', 'stick')): for seacfg, seacfgfile, key in zip_longest(sealist, seacfgfiles, ('main', 'stick')):
if not seacfg: if not seacfg:
continue continue
available = inverted_sea_info[seacfgfile] available = sea_info[seacfg]
if available: if available:
proposed = available[0] if len(available) == 1 else None proposed = available[0] if len(available) == 1 else None
if not proposed: if not proposed: