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(s3): __get_object_lock_configuration__ warning logs #2608

Conversation

jfagoagas
Copy link
Member

Description

Change error logs for warning in the __get_object_lock_configuration__ if the NoSuchBucket exception is raised.

License

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

@jfagoagas jfagoagas requested a review from a team as a code owner July 24, 2023 07:18
Comment on lines +299 to +306
if regional_client:
logger.warning(
f"{regional_client.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)
else:
logger.warning(
f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)
Copy link
Member

Choose a reason for hiding this comment

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

You can avoid repeating this lines by doing it outside the if.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes but we want to raise error logs if a different exception is raised. The ones handled are set with warning.

Copy link
Member

Choose a reason for hiding this comment

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

You're right 👍🏼

Copy link
Member

@sergargar sergargar left a comment

Choose a reason for hiding this comment

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

🔝

@sergargar sergargar merged commit 47a8256 into master Jul 24, 2023
4 checks passed
@sergargar sergargar deleted the PRWLR-2429-prowler-handle-o-such-bucket-291-an-error-occurred-no-such-bucket-when-calling-the-get-object-lock-configuration-operation-the-specified-bucket-does-not-exist branch July 24, 2023 08:49
@sergargar sergargar changed the title fix(s3): __get_object_lock_configuration__ warning logs fix(s3): __get_object_lock_configuration__ warning logs Jul 24, 2023
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.

None yet

2 participants