From 7c027606d9a28e1969de73e98e20d30a60f954c9 Mon Sep 17 00:00:00 2001 From: Marcus Bakker Date: Wed, 15 May 2019 11:00:33 +0200 Subject: [PATCH] small improvement in the health check for tech. YAML files --- generic.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/generic.py b/generic.py index d1e7543..65e0acc 100644 --- a/generic.py +++ b/generic.py @@ -451,12 +451,12 @@ def check_yaml_file_health(filename, file_type): print('[!] Technique ID: ' + tech + ' has an INVALID data format for the key-value pair ' 'in detection: ' + key + ' (should be YYYY-MM-DD)') - for key in ['location', 'applicable_to']: - try: - if detection[key][0] is None: - print('[!] Technique ID: ' + tech + ' is has an EMPTY key-value pair in detection: ' + key) - except TypeError: + for key in ['location', 'applicable_to']: + try: + if detection[key][0] is None: print('[!] Technique ID: ' + tech + ' is has an EMPTY key-value pair in detection: ' + key) + except TypeError: + print('[!] Technique ID: ' + tech + ' is has an EMPTY key-value pair in detection: ' + key) except KeyError: pass @@ -476,3 +476,4 @@ def check_yaml_file_health(filename, file_type): +