diff --git a/frappyman.py b/frappyman.py index 02a604c..e0c901e 100644 --- a/frappyman.py +++ b/frappyman.py @@ -170,12 +170,12 @@ def make_proposed(givencfgs, ourcfgs, seacfgs, sea_info, strict=False, giventitl return result, [' '.join(v.ljust(w) for w, v in zip(wid, row)) for row in rows] -def summarize_server_state(givencfgs, ourcfgs, seacfgs, sea_info, strict=False): +def summarize_server_state(givencfgs, ourcfgs, sealist, sea_info, strict=False): """get a guess for the configuration from information about running services :param givencfgs: dict of given configuration (from nicos cache) :param outcfgs: dict of running configuration (frappy) - :param seacfgs: dict of running configuration (sea) + :param sealist: list of running sea configuration :param sea_info: dict of with info about sea configs :param strict: when True return empty cfg result on error :return: tuple (, , (, ), (, ) where: @@ -200,7 +200,7 @@ def summarize_server_state(givencfgs, ourcfgs, seacfgs, sea_info, strict=False): frappycfgs[addon] = addon seacfgfiles = [(c or '') + SEAEXT.get(s, '.addon') - for c, s in zip_longest(seacfgs, FrappyManager.services)] + for c, s in zip_longest(sealist, FrappyManager.services)] seacfgset = set(seacfgfiles) inverted_sea_info = {k: [] for k in seacfgfiles} for cfg, seacfg in sea_info.items(): @@ -211,7 +211,7 @@ def summarize_server_state(givencfgs, ourcfgs, seacfgs, sea_info, strict=False): addons = set() seacfgs = {} remarks = {} - for seacfg, seacfgfile, key in zip_longest(seacfgs, seacfgfiles, ('main', 'stick')): + for seacfg, seacfgfile, key in zip_longest(sealist, seacfgfiles, ('main', 'stick')): if not seacfg: continue available = inverted_sea_info[seacfgfile] @@ -247,7 +247,7 @@ def summarize_server_state(givencfgs, ourcfgs, seacfgs, sea_info, strict=False): error = True else: pkey = key or seacfg - seacfg[pkey] = seacfg + seacfgs[pkey] = seacfg remarks[pkey] = 'missing frappy config' error = True restart = set()