From 774f33122a44025269f45f178fc02949fc13e956 Mon Sep 17 00:00:00 2001 From: HRPT Date: Wed, 20 Apr 2022 15:52:43 +0200 Subject: [PATCH] fixes in secop_psi/sea.py is_running parameter --- secop_psi/sea.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/secop_psi/sea.py b/secop_psi/sea.py index 0bde526..e83289d 100644 --- a/secop_psi/sea.py +++ b/secop_psi/sea.py @@ -406,7 +406,9 @@ class SeaModule(Module): # with open(join(seaconfdir, json_file + '.json')) as fp: # sea_object, descr = json.load(fp) with open(join(seaconfdir, json_file)) as fp: - descr = json.load(fp)[sea_object] + content = json.load(fp) + # print(json_file, content.keys()) + descr = content[sea_object] if rel_paths == '*' or not rel_paths: # take all main = descr['params'][0] @@ -419,13 +421,14 @@ class SeaModule(Module): # filter by relative paths rel_paths = rel_paths.split() result = [] + is_running = None for rpath in rel_paths: include = True for paramdesc in descr['params']: path = paramdesc['path'] if path.endswith('is_running'): # take this always - result.append(paramdesc) + is_running = paramdesc continue if paramdesc.get('visibility', 1) > visibility_level: continue @@ -437,6 +440,8 @@ class SeaModule(Module): result.append(paramdesc) elif sub[0] == rpath: result.append(paramdesc) + if is_running: # take this at end + result.append(is_running) descr['params'] = result rel0 = '' if rel_paths[0] == '.' else rel_paths[0] if result[0]['path'] == rel0: