Remove the playbook feature text from storage
This commit is contained in:
@ -4,6 +4,8 @@ import json
|
||||
from os.path import isfile
|
||||
from pathlib import Path
|
||||
|
||||
from copy import deepcopy
|
||||
|
||||
def check_file(filename:str) -> bool:
|
||||
data_dir = Path(app.config.get('DATA'))
|
||||
if isfile(f'./{data_dir}/{filename}'): return True
|
||||
@ -11,4 +13,12 @@ def check_file(filename:str) -> bool:
|
||||
|
||||
def load(filename:str) -> dict:
|
||||
data_dir = Path(app.config.get('DATA'))
|
||||
with open(f'./{data_dir}/{filename}') as file: return json.load(file)
|
||||
with open(f'./{data_dir}/{filename}') as file: return json.load(file)
|
||||
|
||||
def declutter_results(raw_results:dict) -> dict:
|
||||
data = deepcopy(raw_results)
|
||||
playbook_lists = []
|
||||
for item in data['playbooks']:
|
||||
playbook_lists.append(list(item.keys())[0])
|
||||
data['playbooks'] = playbook_lists
|
||||
return data
|
Reference in New Issue
Block a user