Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(clean local output dirs): clean dirs when output to s3 #2997

Conversation

n4ch04
Copy link
Contributor

@n4ch04 n4ch04 commented Nov 3, 2023

Context

When sending output to s3 bucket with a custom output directory we were not deleting that local output directory

Description

When options output_bucket or output_bucket_no_assume are set with output_directory and that directory is not the default one -> delete it

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@n4ch04 n4ch04 requested a review from a team November 3, 2023 09:01
@n4ch04 n4ch04 force-pushed the PRWLR-2641-delete-output-folder-when-sending-reports-to-bucket branch from bee3008 to dee643e Compare November 3, 2023 09:03
Comment on lines +305 to +307
# clean local directories
clean_provider_local_output_directories(args)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this function compatible with all providers or do the condition if args.output_bucket or args.output_bucket_no_assume here

@MrCloudSec MrCloudSec self-assigned this Nov 6, 2023
Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Merging #2997 (7efedc6) into master (1a5742d) will decrease coverage by 0.02%.
Report is 8 commits behind head on master.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##           master    #2997      +/-   ##
==========================================
- Coverage   86.34%   86.33%   -0.02%     
==========================================
  Files         559      560       +1     
  Lines       18108    18131      +23     
==========================================
+ Hits        15636    15654      +18     
- Misses       2472     2477       +5     
Files Coverage Δ
prowler/__main__.py 0.00% <0.00%> (ø)
prowler/providers/common/clean.py 83.33% <83.33%> (ø)

... and 2 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@n4ch04 n4ch04 requested a review from MrCloudSec November 7, 2023 14:28
@MrCloudSec MrCloudSec merged commit 299ece1 into master Nov 8, 2023
@MrCloudSec MrCloudSec deleted the PRWLR-2641-delete-output-folder-when-sending-reports-to-bucket branch November 8, 2023 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants