diff --git a/utils/allowlist.py b/utils/allowlist.py index 9eeb0ec..2eae0ea 100644 --- a/utils/allowlist.py +++ b/utils/allowlist.py @@ -26,7 +26,10 @@ def pullPolicyExechistories(url, policiesnames, days, outputjson: bool): file_path = 'chunkinator.json' - # Initialize file if it doesn't exist + # If chunkintor exists - kill and make new + if os.path.exists(file_path): + os.remove(file_path) + if not os.path.exists(file_path): with open(file_path, 'w') as file: json.dump({'error': 'Success', 'response': {'exechistories': []}}, file) @@ -56,10 +59,10 @@ def pullPolicyExechistories(url, policiesnames, days, outputjson: bool): checkpoints_processed = round(len(histories) / array_dividend) print(ct.colorText( - f"{index + 1}/{checkpoints_processed} checkpoint(s) processed. " - f"{'Found with Date Match.' if match_found else ''} Last Checkpoint: {item['checkpoint']}.", "blue")) + f"{index + 1}/{checkpoints_processed} checkpoint(s) processed. " # type: ignore + f"{'Found with Date Match.' if match_found else ''} Last Checkpoint: {item['checkpoint']}.", "blue")) # type: ignore - checkpoint = item['checkpoint'] + checkpoint = item['checkpoint'] # type: ignore if match_found: for item in histories: