mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-01-25 02:08:11 +00:00
fix(check lib): delete comments and debug
This commit is contained in:
@@ -385,13 +385,13 @@ def import_check(check_path: str) -> ModuleType:
|
||||
|
||||
def run_check(check: Check, output_options: Provider_Output_Options) -> list:
|
||||
findings = []
|
||||
if output_options.verbose:
|
||||
print(
|
||||
f"\nCheck ID: {check.check_metadata.CheckID} - {Fore.MAGENTA}{check.check_metadata.ServiceName}{Fore.YELLOW} [{check.check_metadata.Severity}]{Style.RESET_ALL}"
|
||||
)
|
||||
logger.debug(f"Executing check: {check.check_metadata.CheckID}")
|
||||
|
||||
try:
|
||||
print(check)
|
||||
if output_options.verbose:
|
||||
print(
|
||||
f"\nCheck ID: {check.check_metadata.CheckID} - {Fore.MAGENTA}{check.check_metadata.ServiceName}{Fore.YELLOW} [{check.check_metadata.Severity}]{Style.RESET_ALL}"
|
||||
)
|
||||
logger.debug(f"Executing check: {check.check_metadata.CheckID}")
|
||||
findings = check.execute()
|
||||
except Exception as error:
|
||||
if not output_options.only_logs:
|
||||
|
||||
@@ -55,23 +55,14 @@ class Check_Metadata_Model(BaseModel):
|
||||
Compliance: list = None
|
||||
|
||||
|
||||
class Check(ABC): # , Check_Metadata_Model):
|
||||
class Check(ABC):
|
||||
"""Prowler Check"""
|
||||
|
||||
check_metadata: Check_Metadata_Model
|
||||
|
||||
def __init__(self, metadata):
|
||||
"""Check's init function. Calls the CheckMetadataModel init."""
|
||||
# # Parse the Check's metadata file
|
||||
# metadata_file = (
|
||||
# os.path.abspath(sys.modules[self.__module__].__file__)[:-3]
|
||||
# + ".metadata.json"
|
||||
# )
|
||||
# # Store it to validate them with Pydantic
|
||||
# data = Check_Metadata_Model.parse_file(metadata_file).dict()
|
||||
self.check_metadata = metadata
|
||||
# Calls parents init function
|
||||
# super().__init__(**data)
|
||||
|
||||
def metadata(self) -> dict:
|
||||
"""Return the JSON representation of the check's metadata"""
|
||||
|
||||
Reference in New Issue
Block a user