summaryrefslogtreecommitdiff
path: root/src/leap/base/checks.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-11-14 00:38:20 +0900
committerkali <kali@leap.se>2012-11-14 00:38:20 +0900
commit21875404282522a9c83bfb9c85d6a24fa59d20f8 (patch)
treeae0409bd742ce3a6f994ae9bb31fc5ab7225f1c6 /src/leap/base/checks.py
parentf6e900f024074435349eb778a2d89baed55e1e6c (diff)
parentd24c7328fa845737dbb83d512e4b3f287634c4cc (diff)
Merge branch 'feature/generic-wizard' into develop
The generic wizard (big) branch is now stabilised. A bunch of refactors have gone together with this topic branch: - client does not have any info included for default service providers. - user has to run the first-run wizard and manually entry domain for sample provider. - remove all remains of the older branding strategy for default provider. - srp registration + authentication are integrated with the signup process.
Diffstat (limited to 'src/leap/base/checks.py')
-rw-r--r--src/leap/base/checks.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/leap/base/checks.py b/src/leap/base/checks.py
index 7285e74f..23446f4a 100644
--- a/src/leap/base/checks.py
+++ b/src/leap/base/checks.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import logging
import platform
+import socket
import netifaces
import ping
@@ -23,7 +24,7 @@ class LeapNetworkChecker(object):
def run_all(self, checker=None):
if not checker:
checker = self
- self.error = None # ?
+ #self.error = None # ?
# for MVS
checker.check_tunnel_default_interface()
@@ -118,11 +119,9 @@ class LeapNetworkChecker(object):
if packet_loss > constants.MAX_ICMP_PACKET_LOSS:
raise exceptions.NoConnectionToGateway
- # XXX check for name resolution servers
- # dunno what's the best way to do this...
- # check for etc/resolv entries or similar?
- # just try to resolve?
- # is there something in psutil?
-
- # def check_name_resolution(self):
- # pass
+ def check_name_resolution(self, domain_name):
+ try:
+ socket.gethostbyname(domain_name)
+ return True
+ except socket.gaierror:
+ raise exceptions.CannotResolveDomainError