mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 23:05:05 +00:00
fix(quit): Replace with sys.exit() (#1220)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from abc import ABC, abstractmethod
|
||||
from dataclasses import dataclass
|
||||
from typing import List
|
||||
@@ -30,7 +31,7 @@ def load_check_metadata(metadata_file: str) -> dict:
|
||||
check_metadata = Check_Metadata_Model.parse_file(metadata_file)
|
||||
except ValidationError as error:
|
||||
logger.critical(f"Metadata from {metadata_file} is not valid: {error}")
|
||||
quit()
|
||||
sys.exit()
|
||||
else:
|
||||
return check_metadata
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
import sys
|
||||
from io import TextIOWrapper
|
||||
from typing import Any
|
||||
|
||||
@@ -11,7 +12,7 @@ def open_file(input_file: str) -> TextIOWrapper:
|
||||
f = open(input_file)
|
||||
except Exception as e:
|
||||
logger.critical(f"{input_file}: {e.__class__.__name__}")
|
||||
quit()
|
||||
sys.exit()
|
||||
else:
|
||||
return f
|
||||
|
||||
@@ -22,6 +23,6 @@ def parse_json_file(input_file: TextIOWrapper) -> Any:
|
||||
json_file = json.load(input_file)
|
||||
except Exception as e:
|
||||
logger.critical(f"{input_file.name}: {e.__class__.__name__}")
|
||||
quit()
|
||||
sys.exit()
|
||||
else:
|
||||
return json_file
|
||||
|
||||
Reference in New Issue
Block a user