From 7ff88cf819fc7fd0da1e3b452e7056db0d3d88a2 Mon Sep 17 00:00:00 2001 From: SANS Date: Mon, 26 Apr 2021 11:56:48 +0200 Subject: [PATCH] fix issues with sea is_running --- secop_psi/sea.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/secop_psi/sea.py b/secop_psi/sea.py index 3ac2a9d..8d6a1a4 100644 --- a/secop_psi/sea.py +++ b/secop_psi/sea.py @@ -420,7 +420,11 @@ class SeaModule(Module): include = True for paramdesc in descr['params']: path = paramdesc['path'] - if paramdesc.get('visibility', 1) > visibility_level and not path.endswith('is_running'): + if path.endswith('is_running'): + # take this always + result.append(paramdesc) + continue + if paramdesc.get('visibility', 1) > visibility_level: continue sub = path.split('/', 1) if rpath == '.': # take all except subpaths with readonly node at top @@ -431,12 +435,10 @@ class SeaModule(Module): elif sub[0] == rpath: result.append(paramdesc) descr['params'] = result - rel0 = '' if rel_paths[0] == '.' else rel_paths[0] - if result[0]['path'] == rel0: - if issubclass(cls, Readable): - result[0]['key'] = 'value' - else: - result.pop(0) + for valuedesc in result: + if valuedesc['path'] == '': + valuedesc['key'] = 'value' + break else: logger.error('%s: no value found', name) # logger.info('PARAMS %s %r', name, result)