Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: server/site_wlan_connect.py

Issue 2746010: Proper handling of org.chromium.flimflam.Error.InProgress, dbus exception (Closed) Base URL: ssh://gitrw.chromium.org/autotest.git
Patch Set: Change the sleep during "in progress" errors Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/site_wlan_connect.py
diff --git a/server/site_wlan_connect.py b/server/site_wlan_connect.py
index 273cf5e96c8986552bb77dd3485d71d29873ae88..e61ff7095855f5323d275921b755a6695175776c 100644
--- a/server/site_wlan_connect.py
+++ b/server/site_wlan_connect.py
@@ -33,9 +33,12 @@ def DbusSetup():
def ParseProps(props):
proplist = []
- for p in props:
- proplist.append("'%s': '%s'" % (str(p), str(props[p])))
- return '{ %s }' % ', '.join(proplist)
+ if props is not None:
+ for p in props:
+ proplist.append("'%s': '%s'" % (str(p), str(props[p])))
+ return '{ %s }' % ', '.join(proplist)
+ else:
+ return 'None'
def ResetService(init_state):
@@ -85,12 +88,16 @@ def TryConnect(assoc_time):
try:
service.Connect()
- except org.chromium.flimflam.Error.InProgress, e:
- # We can hope that a ResetService in the next call will solve this
- connect_quirks['in_progress'] = 1
- print>>sys.stderr, "Previous connect is still in progress!"
- time.sleep(.5)
- return (None, 'FAIL')
+ except dbus.exceptions.DBusException, e:
+ if e.get_dbus_name() == 'org.chromium.flimflam.Error.InProgress':
+ # We can hope that a ResetService in the next call will solve this
+ connect_quirks['in_progress'] = 1
+ print>>sys.stderr, "Previous connect is still in progress!"
+ time.sleep(5)
Sam Leffler 2010/06/11 22:11:01 These arbitrary sleeps will skew results. But I g
+ return (None, 'FAIL')
+ # What is this exception?
+ print "FAIL(Connect): ssid %s DBus exception %s" %(ssid, e)
+ sys.exit(2)
except Exception, e:
print "FAIL(Connect): ssid %s exception %s" %(ssid, e)
sys.exit(2)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698