Merge lp:~facundo/ubuntuone-client/fix-failure-handling into lp:ubuntuone-client

Proposed by Facundo Batista
Status: Merged
Approved by: dobey
Approved revision: 1255
Merged at revision: 1257
Proposed branch: lp:~facundo/ubuntuone-client/fix-failure-handling
Merge into: lp:ubuntuone-client
Diff against target: 35 lines (+13/-1)
2 files modified
tests/syncdaemon/test_action_queue.py (+12/-0)
ubuntuone/syncdaemon/action_queue.py (+1/-1)
To merge this branch: bzr merge lp:~facundo/ubuntuone-client/fix-failure-handling
Reviewer Review Type Date Requested Status
dobey (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+109699@code.launchpad.net

Commit message

Fix failure handling when creating a share (LP: #1013180).

Description of the change

Fix failure handling when creating a share.

Test included.

To post a comment you must log in.
Revision history for this message
dobey (dobey) wrote :

Is there a bug filed for this? If not, could you please open one? And also please do commit --unchanged --fixes=lp:$bugnum to link the branch to it. Thanks.

review: Needs Information
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
1255. By Facundo Batista

Fixes 1013180

Revision history for this message
Facundo Batista (facundo) wrote :

Rodney, done!

Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/syncdaemon/test_action_queue.py'
2--- tests/syncdaemon/test_action_queue.py 2012-06-12 16:28:38 +0000
3+++ tests/syncdaemon/test_action_queue.py 2012-06-14 13:37:18 +0000
4@@ -3764,6 +3764,18 @@
5 cmd._acquire_pathlock()
6 self.assertEqual(t, [('foo', 'bar'), {'logger': None}])
7
8+ def test_handle_failure_push_event(self):
9+ """Test AQ_CREATE_SHARE_ERROR is pushed on failure."""
10+ msg = 'Something went wrong'
11+ failure = Failure(DefaultException(msg))
12+ cmd = CreateShare(self.request_queue, NODE, 'share_to',
13+ 'share_name', ACCESS_LEVEL_RO, 'marker_id',
14+ os.path.join('foo', 'bar'))
15+ cmd.handle_failure(failure=failure)
16+ events = [('AQ_CREATE_SHARE_ERROR',
17+ {'marker': 'marker_id', 'error': msg})]
18+ self.assertEqual(events, cmd.action_queue.event_queue.events)
19+
20
21 class DeleteShareTestCase(ConnectedBaseTestCase):
22 """Test for DeleteShare ActionQueueCommand."""
23
24=== modified file 'ubuntuone/syncdaemon/action_queue.py'
25--- ubuntuone/syncdaemon/action_queue.py 2012-06-12 18:56:00 +0000
26+++ ubuntuone/syncdaemon/action_queue.py 2012-06-14 13:37:18 +0000
27@@ -1853,7 +1853,7 @@
28 """It didn't work! Push the event."""
29 self.action_queue.event_queue.push('AQ_CREATE_SHARE_ERROR',
30 marker=self.marker,
31- error=failure.value[1])
32+ error=failure.getErrorMessage())
33
34 def _acquire_pathlock(self):
35 """Acquire pathlock."""

Subscribers

People subscribed via source and target branches