Merge ~spencerrunde/ubuntu/+source/landscape-client:noble-devel into ubuntu/+source/landscape-client:ubuntu/noble-devel

Proposed by Spencer Runde
Status: Merged
Approved by: Andreas Hasenack
Approved revision: 504ade5a35902aec896016e6cff3d8fbc87b995c
Merged at revision: 504ade5a35902aec896016e6cff3d8fbc87b995c
Proposed branch: ~spencerrunde/ubuntu/+source/landscape-client:noble-devel
Merge into: ubuntu/+source/landscape-client:ubuntu/noble-devel
Diff against target: 82 lines (+62/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/2057976-fix-ubuntu-pro-registration.patch (+54/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Andreas Hasenack Approve
git-ubuntu import Pending
Review via email: mp+462459@code.launchpad.net

Description of the change

Fix inadvertent removal of Ubuntu Pro info during registration with Landscape Server and add test to cover that case.

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

Confirmed successful build on noble daily

Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

+1

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Sponsored:

Uploading landscape-client_24.02-0ubuntu3.dsc
Uploading landscape-client_24.02-0ubuntu3.debian.tar.xz
Uploading landscape-client_24.02-0ubuntu3_source.buildinfo
Uploading landscape-client_24.02-0ubuntu3_source.changes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 79a5c0b..b6ca536 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+landscape-client (24.02-0ubuntu3) noble; urgency=medium
7+
8+ * d/p/2057976-fix-ubuntu-pro-registration.patch: fix ubuntu pro info not
9+ being sent on registration exchange with Landscape Server (LP: #2057976)
10+
11+ -- Spencer Runde <spencer.runde@canonical.com> Thu, 14 Mar 2024 17:47:11 -0500
12+
13 landscape-client (24.02-0ubuntu2) noble; urgency=medium
14
15 * d/p/2055348-fix-expandvars-arb-exec.patch: fix potential arbitrary shell
16diff --git a/debian/patches/2057976-fix-ubuntu-pro-registration.patch b/debian/patches/2057976-fix-ubuntu-pro-registration.patch
17new file mode 100644
18index 0000000..2f7ce05
19--- /dev/null
20+++ b/debian/patches/2057976-fix-ubuntu-pro-registration.patch
21@@ -0,0 +1,54 @@
22+Description: Fix Ubuntu Pro info not being included in registration message with Landscape Server
23+Origin: upstream, https://github.com/canonical/landscape-client/commit/9683f2016372b90cb2e54bdf56467fa62349a712
24+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/landscape-client/+bug/2057976
25+Last-Update: 2024-03-14
26+---
27+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
28+
29+Index: landscape-client/landscape/client/broker/registration.py
30+===================================================================
31+--- landscape-client.orig/landscape/client/broker/registration.py 2024-03-14 17:35:26.213606859 -0500
32++++ landscape-client/landscape/client/broker/registration.py 2024-03-14 17:39:03.768352695 -0500
33+@@ -8,11 +8,13 @@
34+ credentials yet and that the server accepts registration messages, so it
35+ will craft an appropriate one and send it out.
36+ """
37++import json
38+ import logging
39+
40+ from twisted.internet.defer import Deferred
41+
42+ from landscape.client.broker.exchange import maybe_bytes
43++from landscape.client.manager.ubuntuproinfo import get_ubuntu_pro_info
44+ from landscape.lib.juju import get_juju_info
45+ from landscape.lib.network import get_fqdn
46+ from landscape.lib.tag import is_valid_tag_list
47+@@ -239,6 +241,8 @@
48+ with_tags = f"and tags {tags} " if tags else ""
49+ with_group = f"in access group '{group}' " if group else ""
50+
51++ message["ubuntu_pro_info"] = json.dumps(get_ubuntu_pro_info())
52++
53+ logging.info(
54+ f"Queueing message to register with account {account_name!r} "
55+ f"{with_group}{with_tags}{with_word} a password.",
56+Index: landscape-client/landscape/client/broker/tests/test_registration.py
57+===================================================================
58+--- landscape-client.orig/landscape/client/broker/tests/test_registration.py 2024-03-14 17:35:26.213606859 -0500
59++++ landscape-client/landscape/client/broker/tests/test_registration.py 2024-03-14 17:39:03.768352695 -0500
60+@@ -660,6 +660,15 @@
61+ messages = self.mstore.get_pending_messages()
62+ self.assertEqual(socket.getfqdn(), messages[0]["hostname"])
63+
64++ def test_ubuntu_pro_info_present_in_registration(self):
65++ """Ubuntu Pro info is included to handle licensing in Server"""
66++ self.mstore.set_server_api(b"3.3")
67++ self.mstore.set_accepted_types(["register"])
68++ self.config.computer_title = "Computer Title"
69++ self.config.account_name = "account_name"
70++ self.reactor.fire("pre-exchange")
71++ messages = self.mstore.get_pending_messages()
72++ self.assertIn("ubuntu_pro_info", messages[0])
73+
74+ class JujuRegistrationHandlerTest(RegistrationHandlerTestBase):
75+
76diff --git a/debian/patches/series b/debian/patches/series
77index b372d1f..feace99 100644
78--- a/debian/patches/series
79+++ b/debian/patches/series
80@@ -1 +1,2 @@
81 2055348-fix-expandvars-arb-exec.patch
82+2057976-fix-ubuntu-pro-registration.patch

Subscribers

People subscribed via source and target branches