mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 13:01:56 +00:00
fix(image): correct type annotation and remove dead exception handler
- Fix CheckReportImage metadata parameter type from dict to str - Remove redundant re-raise of already-handled exceptions
This commit is contained in:
@@ -870,7 +870,7 @@ class CheckReportImage(Check_Report):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
metadata: Optional[dict] = None,
|
||||
metadata: Optional[str] = None,
|
||||
finding: Optional[dict] = None,
|
||||
image_name: str = "",
|
||||
) -> None:
|
||||
@@ -878,7 +878,7 @@ class CheckReportImage(Check_Report):
|
||||
Initialize the Container Image Check's finding information from a Trivy vulnerability/secret dict.
|
||||
|
||||
Args:
|
||||
metadata (Dict): Check metadata.
|
||||
metadata (str): Check metadata.
|
||||
finding (dict): A single vulnerability/secret result from Trivy's JSON output.
|
||||
image_name (str): The container image name being scanned.
|
||||
"""
|
||||
|
||||
@@ -173,8 +173,6 @@ class ImageProvider(Provider):
|
||||
file=file_path,
|
||||
message=f"Image list file not found: {file_path}",
|
||||
)
|
||||
except (ImageListFileReadError, ImageListFileNotFoundError):
|
||||
raise
|
||||
except Exception as error:
|
||||
raise ImageListFileReadError(
|
||||
file=file_path,
|
||||
|
||||
Reference in New Issue
Block a user