Skip to content

VPN Fixes + Sanity Checking#282

Open
arianniaki wants to merge 76 commits intoiclab:masterfrom
arianniaki:vpn_fixes
Open

VPN Fixes + Sanity Checking#282
arianniaki wants to merge 76 commits intoiclab:masterfrom
arianniaki:vpn_fixes

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.

3 participants