Strip ifconfig.co output

This commit is contained in:
Oleksii Shevchuk 2017-07-04 18:13:40 +03:00
parent a2f58cc33f
commit f66b463c74
1 changed files with 1 additions and 1 deletions

View File

@ -333,7 +333,7 @@ class SystemInfo(Command):
opener.addheaders = [('User-agent', 'curl/7.50.0')]
response = opener.open('http://ifconfig.co', timeout=5)
if response.code == 200:
self.external_ip = netaddr.IPAddress(response.read())
self.external_ip = netaddr.IPAddress(response.read().strip())
self.internet = True
except Exception, e:
self.external_ip = None