From 08f3e6477a84b8c75c8dd7048ba616dd3544876e Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sun, 1 Nov 2009 15:22:45 -0500 Subject: [PATCH] Retry AP association verification 10 times to accomodate cards that are slow to associate. Thanks to muttoni for the patch. --- wicd/networking.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wicd/networking.py b/wicd/networking.py index 605ca83..4dad92a 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -454,8 +454,14 @@ class ConnectThread(threading.Thread): """ if self.network.get('gateway'): self.SetStatus('verifying_association') - print "Verifying AP association" - retcode = self.iface.VerifyAPAssociation(self.network['gateway']) + print "Verifying AP association..." + for tries in range(1, 11): + print "Attempt %d of 10..." % tries + retcode = self.iface.VerifyAPAssociation(self.network['gateway']) + if retcode == 0: + print "Successfully associated." + break + time.sleep(1) #TODO this should be in wnettools.py if retcode: print "Connection Failed: Failed to ping the access point!"