Merge lp:~dobey/ubuntuone-client/update-3-0 into lp:ubuntuone-client/stable-3-0

Proposed by dobey
Status: Merged
Approved by: Brian Curtin
Approved revision: no longer in the source branch.
Merged at revision: 1194
Proposed branch: lp:~dobey/ubuntuone-client/update-3-0
Merge into: lp:ubuntuone-client/stable-3-0
Diff against target: 140 lines (+49/-5)
6 files modified
data/syncdaemon.conf (+1/-0)
tests/platform/linux/test_credentials.py (+26/-0)
tests/syncdaemon/test_action_queue.py (+12/-0)
ubuntuone/platform/credentials/linux.py (+8/-3)
ubuntuone/proxy/tunnel_client.py (+1/-1)
ubuntuone/syncdaemon/action_queue.py (+1/-1)
To merge this branch: bzr merge lp:~dobey/ubuntuone-client/update-3-0
Reviewer Review Type Date Requested Status
Brian Curtin (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+110396@code.launchpad.net

Commit message

[Facundo Batista]

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

[Roberto Alsina]

    - Added .goutputstream files to the ignore list (Fixes LP:1012620).

[Alejandro Cura]

    - Give the tunnel process a bit more time to account for dns resolving. (LP: #1006899)

[Rodney Dawes]

    - Use dbus.Dictionary to specify signature when using empty dicts for SSO calls. (LP: #711162)

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve
Revision history for this message
Brian Curtin (brian.curtin) :
review: Approve
1194. By dobey

[Facundo Batista]

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

[Roberto Alsina]

    - Added .goutputstream files to the ignore list (Fixes LP:1012620).

[Alejandro Cura]

    - Give the tunnel process a bit more time to account for dns resolving. (LP: #1006899)

[Rodney Dawes]

    - Use dbus.Dictionary to specify signature when using empty dicts for SSO calls. (LP: #711162)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/syncdaemon.conf'
2--- data/syncdaemon.conf 2012-06-06 20:55:28 +0000
3+++ data/syncdaemon.conf 2012-06-14 19:37:24 +0000
4@@ -84,6 +84,7 @@
5 \A.*\.swpx\Z
6 \A\..*\.tmp\Z
7 \A\.~lock\..*#\Z
8+ \A\.goutputstream-.*\Z
9
10 use_trash.default = True
11 use_trash.parser = bool
12
13=== modified file 'tests/platform/linux/test_credentials.py'
14--- tests/platform/linux/test_credentials.py 2012-04-09 20:07:05 +0000
15+++ tests/platform/linux/test_credentials.py 2012-06-14 19:37:24 +0000
16@@ -402,6 +402,32 @@
17 self.assertEqual(self.sso_server._args, params)
18
19
20+class DictSignatureTestCase(DBusTestCase):
21+ """Test the errors with dict signatures."""
22+
23+ def verify(self, app_name, options_dict, reply_handler, error_handler):
24+ """Verify that the options_dict is a dbus.Dictionary."""
25+ self.assertIsInstance(options_dict, dbus.Dictionary)
26+
27+ def test_find_credentials_dict_signature(self):
28+ """Test for find_credentials."""
29+ creds_man = CredentialsManagement()
30+ self.patch(creds_man.sso_proxy, "find_credentials", self.verify)
31+ creds_man.find_credentials()
32+
33+ def test_find_credentials_sync_dict_signature(self):
34+ """Test for find_credentials_sync."""
35+ creds_man = CredentialsManagement()
36+ self.patch(creds_man.sso_proxy, "find_credentials_sync", self.verify)
37+ creds_man.find_credentials_sync()
38+
39+ def test_clear_credentials_dict_signature(self):
40+ """Test for clear_credentials."""
41+ creds_man = CredentialsManagement()
42+ self.patch(creds_man.sso_proxy, "clear_credentials", self.verify)
43+ creds_man.clear_credentials()
44+
45+
46 class SameAppNoErrorTestCase(CredentialsManagementTestCase):
47 """Test case when the app_name matches APP_NAME and there was no error."""
48
49
50=== modified file 'tests/syncdaemon/test_action_queue.py'
51--- tests/syncdaemon/test_action_queue.py 2012-06-13 14:49:56 +0000
52+++ tests/syncdaemon/test_action_queue.py 2012-06-14 19:37:24 +0000
53@@ -3764,6 +3764,18 @@
54 cmd._acquire_pathlock()
55 self.assertEqual(t, [('foo', 'bar'), {'logger': None}])
56
57+ def test_handle_failure_push_event(self):
58+ """Test AQ_CREATE_SHARE_ERROR is pushed on failure."""
59+ msg = 'Something went wrong'
60+ failure = Failure(DefaultException(msg))
61+ cmd = CreateShare(self.request_queue, NODE, 'share_to',
62+ 'share_name', ACCESS_LEVEL_RO, 'marker_id',
63+ os.path.join('foo', 'bar'))
64+ cmd.handle_failure(failure=failure)
65+ events = [('AQ_CREATE_SHARE_ERROR',
66+ {'marker': 'marker_id', 'error': msg})]
67+ self.assertEqual(events, cmd.action_queue.event_queue.events)
68+
69
70 class DeleteShareTestCase(ConnectedBaseTestCase):
71 """Test for DeleteShare ActionQueueCommand."""
72
73=== modified file 'ubuntuone/platform/credentials/linux.py'
74--- ubuntuone/platform/credentials/linux.py 2012-04-09 20:07:05 +0000
75+++ ubuntuone/platform/credentials/linux.py 2012-06-14 19:37:24 +0000
76@@ -30,6 +30,7 @@
77 # files in the program, then also delete it here.
78 """Ubuntu One credentials management dbus service."""
79
80+import dbus
81 import dbus.service
82 import ubuntu_sso
83
84@@ -181,7 +182,8 @@
85 def find_credentials(self, reply_handler=NO_OP, error_handler=NO_OP):
86 """Ask the Ubuntu One credentials."""
87 self.ref_count += 1
88- self.sso_proxy.find_credentials(APP_NAME, {},
89+ self.sso_proxy.find_credentials(APP_NAME,
90+ dbus.Dictionary({}, signature='ss'),
91 reply_handler=reply_handler, error_handler=error_handler)
92
93 @dbus.service.method(dbus_interface=DBUS_CREDENTIALS_IFACE,
94@@ -205,7 +207,9 @@
95 self.ref_count -= 1
96
97 self.ref_count += 1
98- self.sso_proxy.find_credentials_sync(APP_NAME, {},
99+ self.sso_proxy.find_credentials_sync(
100+ APP_NAME,
101+ dbus.Dictionary({}, signature='ss'),
102 reply_handler=decrease_counter_success,
103 error_handler=decrease_counter_error)
104
105@@ -214,7 +218,8 @@
106 def clear_credentials(self, reply_handler=NO_OP, error_handler=NO_OP):
107 """Clear the Ubuntu One credentials."""
108 self.ref_count += 1
109- self.sso_proxy.clear_credentials(APP_NAME, {},
110+ self.sso_proxy.clear_credentials(APP_NAME,
111+ dbus.Dictionary({}, signature='ss'),
112 reply_handler=reply_handler, error_handler=error_handler)
113
114 @dbus.service.method(dbus_interface=DBUS_CREDENTIALS_IFACE,
115
116=== modified file 'ubuntuone/proxy/tunnel_client.py'
117--- ubuntuone/proxy/tunnel_client.py 2012-04-09 20:08:42 +0000
118+++ ubuntuone/proxy/tunnel_client.py 2012-06-14 19:37:24 +0000
119@@ -143,7 +143,7 @@
120 class TunnelProcessProtocol(protocol.ProcessProtocol):
121 """The dialog thru stdout with the tunnel server."""
122
123- timeout = 5
124+ timeout = 30
125
126 def __init__(self, client_d):
127 """Initialize this protocol."""
128
129=== modified file 'ubuntuone/syncdaemon/action_queue.py'
130--- ubuntuone/syncdaemon/action_queue.py 2012-06-13 14:49:56 +0000
131+++ ubuntuone/syncdaemon/action_queue.py 2012-06-14 19:37:24 +0000
132@@ -1853,7 +1853,7 @@
133 """It didn't work! Push the event."""
134 self.action_queue.event_queue.push('AQ_CREATE_SHARE_ERROR',
135 marker=self.marker,
136- error=failure.value[1])
137+ error=failure.getErrorMessage())
138
139 def _acquire_pathlock(self):
140 """Acquire pathlock."""

Subscribers

People subscribed via source and target branches

to all changes: