Handling null router cases
This commit is contained in:
parent
4c62692936
commit
10bdd5aef2
|
@ -172,9 +172,12 @@ class Pinger:
|
||||||
and self.router_log[-2] == -1
|
and self.router_log[-2] == -1
|
||||||
and self.router_log[-3] == -1):
|
and self.router_log[-3] == -1):
|
||||||
|
|
||||||
self.router = self.get_default_gateway_linux()
|
new_router = self.get_default_gateway_linux()
|
||||||
print "Updated router target to "+str(self.router)
|
# Only update router if it's not blank
|
||||||
self.routerLastUpdated = datetime.datetime.now()
|
if new_router != None:
|
||||||
|
self.router = new_router
|
||||||
|
print "Updated router target to "+str(self.router)
|
||||||
|
self.routerLastUpdated = datetime.datetime.now()
|
||||||
|
|
||||||
gobject.timeout_add_seconds(self.timeout, self.ping_both)
|
gobject.timeout_add_seconds(self.timeout, self.ping_both)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user