Merge lp:~gocept/landscape-client/py3-broker-amp-server into lp:~landscape/landscape-client/trunk

Proposed by Steffen Allner
Status: Merged
Merged at revision: 981
Proposed branch: lp:~gocept/landscape-client/py3-broker-amp-server
Merge into: lp:~landscape/landscape-client/trunk
Prerequisite: lp:~gocept/landscape-client/py3-broker-exchange
Diff against target: 43 lines (+5/-5)
3 files modified
landscape/broker/amp.py (+1/-1)
landscape/broker/tests/test_server.py (+2/-2)
py3_ready_tests (+2/-2)
To merge this branch: bzr merge lp:~gocept/landscape-client/py3-broker-amp-server
Reviewer Review Type Date Requested Status
Eric Snow (community) Approve
Daniel Havlik (community) Approve
🤖 Landscape Builder test results Approve
Review via email: mp+321037@code.launchpad.net

Commit message

This is the port of landscape.broker.amp to Python 3.

This involved adjusting to the change in dict.keys().

Description of the change

This MP contains the last fixes to the landscape.broker module in order to run it with python3.

First, we need a list in broker.amp to get a serialized version of the data, which does not work with dict_keys. Also the assertion dict_values([]) != [] breaks tests, so I adapted them to use the length for testing for an empty iterable.

To post a comment you must log in.
Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: TRIAL_ARGS=-j4 make check
Result: Success
Revno: 976
Branch: lp:~gocept/landscape-client/py3-broker-amp-server
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3784/

review: Approve (test results)
Revision history for this message
Daniel Havlik (nilo) wrote :

+1

review: Approve
Revision history for this message
Eric Snow (ericsnowcurrently) wrote :

LGTM

review: Approve
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Attempt to merge into lp:landscape-client failed due to conflicts:

text conflict in py3_ready_tests

Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

No approved revision specified.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'landscape/broker/amp.py'
2--- landscape/broker/amp.py 2017-01-09 16:10:31 +0000
3+++ landscape/broker/amp.py 2017-03-27 07:39:05 +0000
4@@ -29,7 +29,7 @@
5 the given event types occurs in the broker reactor, the associated
6 callable will be fired.
7 """
8- result = self.listen_events(handlers.keys())
9+ result = self.listen_events(list(handlers.keys()))
10 return result.addCallback(
11 lambda args: handlers[args[0]](**args[1]))
12
13
14=== modified file 'landscape/broker/tests/test_server.py'
15--- landscape/broker/tests/test_server.py 2016-06-01 12:46:51 +0000
16+++ landscape/broker/tests/test_server.py 2017-03-27 07:39:05 +0000
17@@ -147,9 +147,9 @@
18 client components that need to communicate with the server. After
19 the registration they can be fetched with L{BrokerServer.get_clients}.
20 """
21- self.assertEqual(self.broker.get_clients(), [])
22+ self.assertEqual(len(self.broker.get_clients()), 0)
23 self.assertEqual(self.broker.get_client("test"), None)
24- self.assertEqual(self.broker.get_connectors(), [])
25+ self.assertEqual(len(self.broker.get_connectors()), 0)
26 self.assertEqual(self.broker.get_connector("test"), None)
27
28 def assert_registered(ignored):
29
30=== modified file 'py3_ready_tests'
31--- py3_ready_tests 2017-03-27 07:39:05 +0000
32+++ py3_ready_tests 2017-03-27 07:39:05 +0000
33@@ -6,8 +6,8 @@
34
35 landscape.tests.test_schema
36
37-
38-
39+landscape.broker.tests.test_amp
40+landscape.broker.tests.test_server
41
42 landscape.broker.tests.test_exchange
43 landscape.broker.tests.test_store

Subscribers

People subscribed via source and target branches

to all changes: