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 run tunnel helper #6292

Merged
merged 3 commits into from Aug 25, 2021
Merged

Conversation

kozlovsky
Copy link
Collaborator

This PR fixes run_tunnel_helper.py scripts so it can work with component architecture.
It depends on #6291 and can be merged after #6291 is merged.

@sonarcloud
Copy link

sonarcloud bot commented Aug 25, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@kozlovsky kozlovsky marked this pull request as draft August 25, 2021 10:49
class IPAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
try:
inet_aton(values)
Copy link
Contributor

@qstokkink qstokkink Aug 25, 2021

Choose a reason for hiding this comment

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

Please consider using ipaddress.IPv4Address() instead of inet_aton(). This allows you to only catch AddressValueError exceptions (instead of general exceptions) and gives you a message that shows exactly what is wrong with the given IP address.

EDIT: this should probably not be part of this PR though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, will made another PR with this fix

Copy link
Contributor

@qstokkink qstokkink left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@kozlovsky kozlovsky marked this pull request as ready for review August 25, 2021 11:31
@kozlovsky kozlovsky merged commit ee4512c into Tribler:main Aug 25, 2021
@kozlovsky kozlovsky deleted the fix_run_tunnel_helper branch August 25, 2021 13:26
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