Merge lp:~lifeless/txaws/client into lp:~txawsteam/txaws/trunk

Proposed by Robert Collins
Status: Merged
Merged at revision: not available
Proposed branch: lp:~lifeless/txaws/client
Merge into: lp:~txawsteam/txaws/trunk
Diff against target: None lines
To merge this branch: bzr merge lp:~lifeless/txaws/client
Reviewer Review Type Date Requested Status
Original txAWS Team Pending
Review via email: mp+6259@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

Fix a bug with timeouts causing the gtk client to crash.

lp:~lifeless/txaws/client updated
5. By Robert Collins

Handle timeout errors in the gtk gui.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'txaws/client/gui/gtk.py'
2--- txaws/client/gui/gtk.py 2009-04-30 13:49:08 +0000
3+++ txaws/client/gui/gtk.py 2009-05-06 14:28:00 +0000
4@@ -108,7 +108,7 @@
5 # credentials.
6 return
7 self.probing = True
8- self.client.describe_instances().addCallbacks(self.showhide, self.errorit)
9+ self.client.describe_instances().addCallbacks(self.showhide, self.describe_error)
10
11 def on_popup_menu(self, status, button, time):
12 self.menu.popup(None, None, None, button, time)
13@@ -116,7 +116,7 @@
14 def on_stop_instances(self, data):
15 # It would be nice to popup a window to select instances.. TODO.
16 self.client.describe_instances().addCallbacks(self.shutdown_instances,
17- self.errorit)
18+ self.show_error)
19
20 def save_key(self, response_id, data):
21 # handle the dialog
22@@ -153,15 +153,28 @@
23 def shutdown_instances(self, reservation):
24 d = self.client.terminate_instances(
25 *[instance.instanceId for instance in reservation])
26- d.addCallbacks(self.on_activate, self.errorit)
27+ d.addCallbacks(self.on_activate, self.show_error)
28
29 def queue_check(self):
30 self.probing = False
31 self.reactor.callLater(60, self.on_activate, None)
32
33- def errorit(self, error):
34+ def show_error(self, error):
35 # debugging output for now.
36- print error.value, error.value.response
37+ print error.value
38+ try:
39+ print error.value.response
40+ except:
41+ pass
42+
43+ def describe_error(self, error):
44+ if isinstance(error.value, twisted.internet.defer.TimeoutError):
45+ # timeout errors can be ignored - transient network issue or some
46+ # such.
47+ pass
48+ else:
49+ # debugging output for now.
50+ self.show_error(error)
51 self.queue_check()
52
53

Subscribers

People subscribed via source and target branches