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

VPN Fixes + Sanity Checking #282

Open
wants to merge 76 commits into
base: master
Choose a base branch
from
Open

VPN Fixes + Sanity Checking #282

wants to merge 76 commits into from

Conversation

arianniaki
Copy link
Collaborator

The line ip = socket.gethostbyname(hostname) would cause the following error before the fix
[Errno 8] nodename nor servname provided, or not known

Copy link
Collaborator

@rpanah rpanah left a comment

Choose a reason for hiding this comment

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

@arianniaki have you tested these changes? i.e. can you download all configurations and run VPN instances using the new configurations?

break
# added because gethostbyname will fail on some hostnames
try:
ip = socket.gethostbyname(hostname)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will entirely ignore cases where this happens. It would be better to print a log message to describe what happens and which domain name failed to resolve.

break
# added because gethostbyname will fail on some hostnames
try:
ip = socket.gethostbyname(hostname)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as before, leave a log message saying what happened and what failed to parse.

break
# added because gethostbyname will fail on some hostnames
try:
ip = socket.gethostbyname(hostname)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@arianniaki I see your comment.

ip = socket.gethostbyname(hostname)
break
except socket.gaierror:
logging.info("Hostname %s failed" %hostname)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Replace with Failed to resolve %s.

ip = socket.gethostbyname(hostname)
break
except socket.gaierror:
logging.info("Hostname %s failed" %hostname)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above. Failed to resolve %s

ip = socket.gethostbyname(hostname)
break
except socket.gaierror:
logging.info("Hostname %s failed" %hostname)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above.

@arianniaki arianniaki changed the title Try Except added to getting ip addresses of purevpn and ipvanish VPN Fixes + Sanity Checking Feb 12, 2018
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

3 participants