mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
fix(json): close Json correctly when no findings (#1773)
Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
@@ -71,7 +71,8 @@ def close_json(output_filename, output_directory, mode):
|
||||
)
|
||||
# Replace last comma for square bracket if not empty
|
||||
if file_descriptor.tell() > 0:
|
||||
file_descriptor.seek(file_descriptor.tell() - 1, os.SEEK_SET)
|
||||
if file_descriptor.tell() != 1:
|
||||
file_descriptor.seek(file_descriptor.tell() - 1, os.SEEK_SET)
|
||||
file_descriptor.truncate()
|
||||
file_descriptor.write("]")
|
||||
file_descriptor.close()
|
||||
|
||||
@@ -32,7 +32,7 @@ def stdout_report(finding, color, verbose, is_quiet):
|
||||
if finding.check_metadata.Provider == "azure":
|
||||
details = finding.check_metadata.ServiceName
|
||||
|
||||
if verbose:
|
||||
if verbose and not (is_quiet and finding.status != "FAIL"):
|
||||
print(
|
||||
f"\t{color}{finding.status}{Style.RESET_ALL} {details}: {finding.status_extended}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user