Bugfix: date in auto updated yaml file was in YYYY-MM-DD format what errors when auto updating the YAML again. Using long datetime format like in the Editor.

master
Ruben 2020-04-16 15:18:27 +02:00
parent 516472b7ee
commit 23b0324e75
2 changed files with 2 additions and 2 deletions

View File

@ -529,7 +529,7 @@ def generate_technique_administration_file(filename, write_file=True, all_techni
yaml_file['name'] = name
yaml_file['platform'] = platform
yaml_file['techniques'] = []
today = dt.now().strftime('%Y-%m-%d')
today = dt.now()
# Score visibility based on the number of available data sources and the exceptions
for t in techniques:

View File

@ -493,7 +493,7 @@ def fix_date_and_remove_null(yaml_file, date, input_type='ruamel'):
elif input_type == 'file':
new_lines = yaml_file.readlines()
fixed_lines = [l.replace('\'' + date + '\'', date).replace('null', '')
fixed_lines = [l.replace('\'' + str(date) + '\'', str(date)).replace('null', '')
if REGEX_YAML_DATE.match(l) else
l.replace('null', '') for l in new_lines]