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

[6.14.z] Add Ruff rule group B (flake8-bugbear) #13695

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

JacobCallahan
Copy link
Member

Cherry-pick of #13491

This change includes the rule addition and mostly manual changes to existing code in order to bring it in line with the new rules and avoid as many ignores as is reasonable.

I added a number of {{from err}} statements to the end of exceptions that currently include the error message. The error message being included in the raised string can be removed later, but keeping for consistency for now.

In cases where I raised from None, the raised exception is clear enough that the additional context of the parent exception isn't helpful.

cli/test_ping.py has a zip that should probably be strict.

fixes #13688

This change includes the rule addition and mostly manual changes to
existing code in order to bring it in line with the new rules and avoid
as many ignores as is reasonable.

I added a number of {{from err}} statements to the end of exceptions that currently include the error message. The
error message being included in the raised string can be removed later, but keeping for consistency for now.

In cases where I raised from None, the raised exception is clear enough that the additional context of the parent
exception isn't helpful.

cli/test\_ping.py has a zip that should probably be strict.
@JacobCallahan JacobCallahan added Framework Changes A modification of the robottelo framework No-CherryPick PR doesnt need CherryPick to previous branches 6.14.z Introduced in or relating directly to Satellite 6.14 labels Jan 9, 2024
@JacobCallahan JacobCallahan linked an issue Jan 9, 2024 that may be closed by this pull request
@@ -235,9 +235,9 @@ def available_capsule_port(self):
:rtype: int
"""
port_pool_range = settings.fake_capsules.port_range
if type(port_pool_range) is str:
if isinstance(port_pool_range, list):
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it correct?

Suggested change
if isinstance(port_pool_range, list):
if isinstance(port_pool_range, str):

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

nice catch!

Copy link
Collaborator

Choose a reason for hiding this comment

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

@JacobCallahan Could you fix this in master branch manually?
I'll add similar comments to your other cherrypick PRs and we can commit this suggestion in same way

Copy link
Collaborator

Choose a reason for hiding this comment

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

manual fix required for master and 6.15.z branches*

fix type check from list to str

Co-authored-by: Gaurav Talreja <[email protected]>
@Gauravtalreja1 Gauravtalreja1 merged commit 64b9784 into SatelliteQE:6.14.z Jan 10, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z Introduced in or relating directly to Satellite 6.14 Framework Changes A modification of the robottelo framework No-CherryPick PR doesnt need CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Failed-AutoCherryPick] - Add Ruff rule group B (flake8-bugbear)
2 participants