From 078ac7c600c6a513efda46cc54c7ab8391ec340b Mon Sep 17 00:00:00 2001 From: SANS Date: Mon, 26 Apr 2021 16:04:33 +0200 Subject: [PATCH] fix 'ts' value --- secop_psi/sea.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/secop_psi/sea.py b/secop_psi/sea.py index 3cdf240..25bb43d 100644 --- a/secop_psi/sea.py +++ b/secop_psi/sea.py @@ -401,11 +401,7 @@ class SeaModule(Module): include = True for paramdesc in descr['params']: path = paramdesc['path'] - if path.endswith('is_running'): - # take this always - result.append(paramdesc) - continue - if paramdesc.get('visibility', 1) > visibility_level: + if paramdesc.get('visibility', 1) > visibility_level and not path.endswith('is_running'): continue sub = path.split('/', 1) if rpath == '.': # take all except subpaths with readonly node at top @@ -416,10 +412,9 @@ class SeaModule(Module): elif sub[0] == rpath: result.append(paramdesc) descr['params'] = result - for valuedesc in result: - if valuedesc['path'] == '': - valuedesc['key'] = 'value' - break + rel0 = '' if rel_paths[0] == '.' else rel_paths[0] + if result[0]['path'] == rel0: + result[0]['key'] = 'value' else: logger.error('%s: no value found', name) # logger.info('PARAMS %s %r', name, result)