Merge lp:~ericsnowcurrently/landscape-client/fix-1680827-hash-id-dbs-url into lp:~landscape/landscape-client/trunk

Proposed by Eric Snow on 2017-04-13
Status: Merged
Approved by: Eric Snow on 2017-04-14
Approved revision: 1019
Merged at revision: 1018
Proposed branch: lp:~ericsnowcurrently/landscape-client/fix-1680827-hash-id-dbs-url
Merge into: lp:~landscape/landscape-client/trunk
Diff against target: 28 lines (+4/-2)
2 files modified
landscape/broker/exchange.py (+2/-0)
landscape/broker/tests/test_exchange.py (+2/-2)
To merge this branch: bzr merge lp:~ericsnowcurrently/landscape-client/fix-1680827-hash-id-dbs-url
Reviewer Review Type Date Requested Status
Simon Poirier 2017-04-13 Approve on 2017-04-14
🤖 Landscape Builder test results Approve on 2017-04-13
Alberto Donato 2017-04-13 Approve on 2017-04-13
Review via email: mp+322534@code.launchpad.net

Commit message

Convert the received server UUID to unicode.

(fixes lp:1680827)

Description of the change

Convert the received server UUID to unicode.

(fixes lp:1680827)

Testing instructions:

dev/advicedog > server.log
sudo ./scripts/landscape-client -c root-client.conf
# accept computer in UI
grep 'GET /hash-id-databases/' server.log # the server UUID will not be wrapped in b''.

To post a comment you must log in.
review: Abstain (executing tests)
Alberto Donato (ack) wrote :

+1

review: Approve

Command: TRIAL_ARGS=-j4 make ci-check
Result: Success
Revno: 1019
Branch: lp:~ericsnowcurrently/landscape-client/fix-1680827-hash-id-dbs-url
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3874/

review: Approve (test results)
Simon Poirier (simpoir) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'landscape/broker/exchange.py'
2--- landscape/broker/exchange.py 2017-04-06 08:09:22 +0000
3+++ landscape/broker/exchange.py 2017-04-13 15:44:26 +0000
4@@ -764,6 +764,8 @@
5
6 old_uuid = message_store.get_server_uuid()
7 new_uuid = result.get("server-uuid")
8+ if new_uuid and isinstance(new_uuid, bytes):
9+ new_uuid = new_uuid.decode("ascii")
10 if new_uuid != old_uuid:
11 logging.info("Server UUID changed (old=%s, new=%s)."
12 % (old_uuid, new_uuid))
13
14=== modified file 'landscape/broker/tests/test_exchange.py'
15--- landscape/broker/tests/test_exchange.py 2017-03-23 10:41:04 +0000
16+++ landscape/broker/tests/test_exchange.py 2017-04-13 15:44:26 +0000
17@@ -850,10 +850,10 @@
18 self.assertEqual(b"3.3", self.mstore.get_server_api())
19
20 def test_server_uuid_is_stored_on_message_store(self):
21- self.transport.extra["server-uuid"] = "first-uuid"
22+ self.transport.extra["server-uuid"] = b"first-uuid"
23 self.exchanger.exchange()
24 self.assertEqual(self.mstore.get_server_uuid(), "first-uuid")
25- self.transport.extra["server-uuid"] = "second-uuid"
26+ self.transport.extra["server-uuid"] = b"second-uuid"
27 self.exchanger.exchange()
28 self.assertEqual(self.mstore.get_server_uuid(), "second-uuid")
29

Subscribers

People subscribed via source and target branches

to all changes: