Skip to content

Commit

Permalink
fix other providers
Browse files Browse the repository at this point in the history
  • Loading branch information
sergargar committed Apr 2, 2024
1 parent 170e301 commit d5518a9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion prowler/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def prowler():
)

# Prowler Fixer
if args.fix:
if getattr(args, "fix", None):
print(f"{Style.BRIGHT}\nRunning Prowler Fixer, please wait...{Style.RESET_ALL}")

Check warning on line 216 in prowler/__main__.py

View check run for this annotation

Codecov / codecov/patch

prowler/__main__.py#L215-L216

Added lines #L215 - L216 were not covered by tests
# Check if there are any FAIL findings
if any("FAIL" in finding.status for finding in findings):
Expand Down
2 changes: 1 addition & 1 deletion prowler/lib/banner.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def print_banner(args):
"""
print(banner)

if args.verbose or args.fix:
if args.verbose or getattr(args, "fix", False):

Check warning on line 18 in prowler/lib/banner.py

View check run for this annotation

Codecov / codecov/patch

prowler/lib/banner.py#L18

Added line #L18 was not covered by tests
print(
f"""
Color code for results:
Expand Down
2 changes: 1 addition & 1 deletion prowler/lib/check/checks_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def load_checks_to_execute(

# Only execute threat detection checks if threat-detection category is set
if "threat-detection" not in categories:
for threat_detection_check in check_categories["threat-detection"]:
for threat_detection_check in check_categories.get("threat-detection", []):
checks_to_execute.discard(threat_detection_check)

# Check Aliases
Expand Down
4 changes: 2 additions & 2 deletions prowler/providers/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def __init__(self, arguments, bulk_checks_metadata):
self.only_logs = arguments.only_logs
self.unix_timestamp = arguments.unix_timestamp
self.shodan_api_key = arguments.shodan
self.fix = arguments.fix
self.fix = getattr(arguments, "fix", None)

# Shodan API Key
if arguments.shodan:
update_provider_config("shodan_api_key", arguments.shodan)

# Check output directory, if it is not created -> create it
if arguments.output_directory and not arguments.fix:
if arguments.output_directory and not self.fix:
if not isdir(arguments.output_directory):
if arguments.output_formats:
makedirs(arguments.output_directory, exist_ok=True)
Expand Down

0 comments on commit d5518a9

Please sign in to comment.