Merge lp:~facundo/ubuntuone-client/aq-log-hostport-ok into lp:ubuntuone-client

Proposed by Facundo Batista
Status: Merged
Approved by: Facundo Batista
Approved revision: 948
Merged at revision: 951
Proposed branch: lp:~facundo/ubuntuone-client/aq-log-hostport-ok
Merge into: lp:ubuntuone-client
Diff against target: 37 lines (+15/-1)
2 files modified
tests/syncdaemon/test_action_queue.py (+14/-0)
ubuntuone/syncdaemon/action_queue.py (+1/-1)
To merge this branch: bzr merge lp:~facundo/ubuntuone-client/aq-log-hostport-ok
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
dobey (community) Approve
Review via email: mp+57011@code.launchpad.net

Commit message

Log the real host:port to which just connected (LP: #693456).

Description of the change

Log the real host:port to which just connected.

Test included

To post a comment you must log in.
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) :
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 2011-04-08 19:51:31 +0000
3+++ tests/syncdaemon/test_action_queue.py 2011-04-08 20:31:42 +0000
4@@ -1237,6 +1237,20 @@
5
6 yield self._disconnect_factory()
7
8+ def test_connection_started_logging(self):
9+ """Test that the connection started logs connector info, not AQ's."""
10+ assert self.action_queue.host == '127.0.0.1'
11+ assert self.action_queue.port == 0
12+
13+ class FakeConnector(object):
14+ """Fake connector."""
15+ host = '1.2.3.4'
16+ port = 4321
17+
18+ self.action_queue.startedConnecting(FakeConnector())
19+ self.assertTrue(self.handler.check_info("Connection started",
20+ "host 1.2.3.4", "port 4321"))
21+
22
23 class NetworkmanagerTestCase(FactoryBaseTestCase):
24 """Base test case generating a connected factory."""
25
26=== modified file 'ubuntuone/syncdaemon/action_queue.py'
27--- ubuntuone/syncdaemon/action_queue.py 2011-04-08 19:51:31 +0000
28+++ ubuntuone/syncdaemon/action_queue.py 2011-04-08 20:31:42 +0000
29@@ -819,7 +819,7 @@
30 def startedConnecting(self, connector):
31 """Called when a connection has been started."""
32 logger.info('Connection started to host %s, port %s.',
33- self.host, self.port)
34+ connector.host, connector.port)
35
36 def disconnect(self):
37 """Disconnect the client.

Subscribers

People subscribed via source and target branches