Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu/jammy: fix dailies #5712

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ cloud-init (24.3.1-0ubuntu0~22.04.2) UNRELEASED; urgency=medium

* refresh patches:
- d/p/keep-dhclient-as-priority-client.patch
- d/p/no-nocloud-network.patch
- d/p/no-single-process.patch
* Upstream snapshot based on upstream/main at a9c6b140.
- d/p/revert-551f560d-cloud-config-after-snap-seeding.patch
* Upstream snapshot based on upstream/main at df75b526..

-- Chad Smith <[email protected]> Fri, 13 Sep 2024 08:17:58 -0600

Expand Down
26 changes: 13 additions & 13 deletions debian/patches/no-nocloud-network.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Last-Update: 2024-08-02

--- a/cloudinit/sources/DataSourceNoCloud.py
+++ b/cloudinit/sources/DataSourceNoCloud.py
@@ -190,7 +190,7 @@
@@ -190,7 +190,7 @@ class DataSourceNoCloud(sources.DataSour

# This could throw errors, but the user told us to do it
# so if errors are raised, let them raise
Expand All @@ -16,7 +16,7 @@ Last-Update: 2024-08-02
LOG.debug("Using seeded cache data from %s", seedfrom)

# Values in the command line override those from the seed
@@ -199,7 +199,6 @@
@@ -199,7 +199,6 @@ class DataSourceNoCloud(sources.DataSour
)
mydata["user-data"] = ud
mydata["vendor-data"] = vd
Expand All @@ -26,15 +26,15 @@ Last-Update: 2024-08-02
# Now that we have exhausted any other places merge in the defaults
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -1059,7 +1059,6 @@
@@ -1059,7 +1059,6 @@ def read_seeded(base="", ext="", timeout
ud_url = base.replace("%s", "user-data" + ext)
vd_url = base.replace("%s", "vendor-data" + ext)
md_url = base.replace("%s", "meta-data" + ext)
- network_url = base.replace("%s", "network-config" + ext)
else:
if features.NOCLOUD_SEED_URL_APPEND_FORWARD_SLASH:
if base[-1] != "/" and parse.urlparse(base).query == "":
@@ -1068,17 +1067,7 @@
@@ -1068,17 +1067,7 @@ def read_seeded(base="", ext="", timeout
ud_url = "%s%s%s" % (base, "user-data", ext)
vd_url = "%s%s%s" % (base, "vendor-data", ext)
md_url = "%s%s%s" % (base, "meta-data", ext)
Expand All @@ -54,7 +54,7 @@ Last-Update: 2024-08-02
)
--- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py
@@ -2481,7 +2481,7 @@
@@ -2481,7 +2481,7 @@ class TestReadOptionalSeed:
{
"meta-data": {"md": "val"},
"user-data": b"ud",
Expand All @@ -63,7 +63,7 @@ Last-Update: 2024-08-02
"vendor-data": None,
},
True,
@@ -2536,7 +2536,7 @@
@@ -2536,7 +2536,7 @@ class TestReadSeeded:
assert found_md == {"key1": "val1"}
assert found_ud == ud
assert found_vd == vd
Expand All @@ -72,47 +72,47 @@ Last-Update: 2024-08-02

@pytest.mark.parametrize(
"base, feature_flag, req_urls",
@@ -2545,7 +2545,6 @@
@@ -2545,7 +2545,6 @@ class TestReadSeeded:
"http://10.0.0.1/%s?qs=1",
True,
[
- "http://10.0.0.1/network-config?qs=1",
"http://10.0.0.1/meta-data?qs=1",
"http://10.0.0.1/user-data?qs=1",
"http://10.0.0.1/vendor-data?qs=1",
@@ -2556,7 +2555,6 @@
@@ -2556,7 +2555,6 @@ class TestReadSeeded:
"https://10.0.0.1:8008/",
True,
[
- "https://10.0.0.1:8008/network-config",
"https://10.0.0.1:8008/meta-data",
"https://10.0.0.1:8008/user-data",
"https://10.0.0.1:8008/vendor-data",
@@ -2567,7 +2565,6 @@
@@ -2567,7 +2565,6 @@ class TestReadSeeded:
"https://10.0.0.1:8008",
True,
[
- "https://10.0.0.1:8008/network-config",
"https://10.0.0.1:8008/meta-data",
"https://10.0.0.1:8008/user-data",
"https://10.0.0.1:8008/vendor-data",
@@ -2578,7 +2575,6 @@
@@ -2578,7 +2575,6 @@ class TestReadSeeded:
"https://10.0.0.1:8008",
False,
[
- "https://10.0.0.1:8008network-config",
"https://10.0.0.1:8008meta-data",
"https://10.0.0.1:8008user-data",
"https://10.0.0.1:8008vendor-data",
@@ -2589,7 +2585,6 @@
@@ -2589,7 +2585,6 @@ class TestReadSeeded:
"https://10.0.0.1:8008?qs=",
True,
[
- "https://10.0.0.1:8008?qs=network-config",
"https://10.0.0.1:8008?qs=meta-data",
"https://10.0.0.1:8008?qs=user-data",
"https://10.0.0.1:8008?qs=vendor-data",
@@ -2628,7 +2623,7 @@
@@ -2628,7 +2623,7 @@ class TestReadSeeded:
# user-data, vendor-data read raw. It could be scripts or other format
assert found_ud == "/user-data: 1"
assert found_vd == "/vendor-data: 1"
Expand All @@ -121,7 +121,7 @@ Last-Update: 2024-08-02
assert [
mock.call(req_url, timeout=5, retries=10) for req_url in req_urls
] == m_read.call_args_list
@@ -2658,7 +2653,7 @@
@@ -2658,7 +2653,7 @@ class TestReadSeededWithoutVendorData(he
self.assertEqual(found_md, {"key1": "val1"})
self.assertEqual(found_ud, ud)
self.assertEqual(found_vd, vd)
Expand Down
20 changes: 10 additions & 10 deletions debian/patches/no-single-process.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Last-Update: 2024-08-02

--- a/systemd/cloud-config.service.tmpl
+++ b/systemd/cloud-config.service.tmpl
@@ -10,14 +10,7 @@
@@ -10,14 +10,7 @@ ConditionEnvironment=!KERNEL_CMDLINE=clo

[Service]
Type=oneshot
Expand All @@ -24,7 +24,7 @@ Last-Update: 2024-08-02

--- a/systemd/cloud-final.service.tmpl
+++ b/systemd/cloud-final.service.tmpl
@@ -15,16 +15,10 @@
@@ -15,16 +15,10 @@ ConditionEnvironment=!KERNEL_CMDLINE=clo

[Service]
Type=oneshot
Expand All @@ -40,20 +40,20 @@ Last-Update: 2024-08-02
RemainAfterExit=yes
TimeoutSec=0
+KillMode=process
{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
# Restart NetworkManager if it is present and running.
ExecStartPost=/bin/sh -c 'u=NetworkManager.service; \
TasksMax=infinity
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes


# Output needs to appear in instance console output
--- a/systemd/cloud-init-local.service.tmpl
+++ b/systemd/cloud-init-local.service.tmpl
@@ -7,6 +7,7 @@
@@ -7,6 +7,7 @@ DefaultDependencies=no
{% endif %}
Wants=network-pre.target
After=hv_kvp_daemon.service
+After=systemd-remount-fs.service
{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
Requires=dbus.socket
After=dbus.socket
@@ -37,14 +38,7 @@
@@ -37,14 +38,7 @@ ExecStartPre=/bin/mkdir -p /run/cloud-in
ExecStartPre=/sbin/restorecon /run/cloud-init
ExecStartPre=/usr/bin/touch /run/cloud-init/enabled
{% endif %}
Expand Down Expand Up @@ -252,7 +252,7 @@ Last-Update: 2024-08-02
+WantedBy=cloud-init.target
--- a/cloudinit/cmd/status.py
+++ b/cloudinit/cmd/status.py
@@ -321,9 +321,8 @@
@@ -321,9 +321,8 @@ def systemd_failed(wait: bool) -> bool:
for service in [
"cloud-final.service",
"cloud-config.service",
Expand All @@ -265,7 +265,7 @@ Last-Update: 2024-08-02
stdout = query_systemctl(
--- a/cloudinit/config/cc_mounts.py
+++ b/cloudinit/config/cc_mounts.py
@@ -525,7 +525,7 @@
@@ -525,7 +525,7 @@ def handle(name: str, cfg: Config, cloud
# fs_spec, fs_file, fs_vfstype, fs_mntops, fs-freq, fs_passno
uses_systemd = cloud.distro.uses_systemd()
default_mount_options = (
Expand Down Expand Up @@ -303,7 +303,7 @@ Last-Update: 2024-08-02
+After=cloud-init-local.service cloud-init.service
--- a/tests/unittests/config/test_cc_mounts.py
+++ b/tests/unittests/config/test_cc_mounts.py
@@ -566,9 +566,9 @@
@@ -566,9 +566,9 @@ class TestFstabHandling:
LABEL=keepme none ext4 defaults 0 0
LABEL=UEFI
/dev/sda4 /mnt2 auto nofail,comment=cloudconfig 1 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,22 +147,21 @@ Last-Update: 2024-02-14
install = cc.distro.install_packages

for backend, cmd, package in BACKEND_DEF:
@@ -88,23 +84,21 @@ class TestLxd(t_help.CiTestCase):
if backend == "lvm":
self.assertEqual(
[
@@ -85,22 +81,14 @@ class TestLxd(t_help.CiTestCase):
subp.call_args_list,
)

- if backend == "lvm":
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is... confusing. The original test checks to make sure that the semaphore exists when waiting for snap. But on jammy, I'm not sure why we are still testing for this call. Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we were testing the dm-thin-pool.ko that was just removed, so I removed that as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we were testing the dm-thin-pool.ko that was just removed, so I removed that as well.

I know, I'm commenting on the remaining test. I don't think that it tests anything valuable, but I guess it doesn't hurt anything either.

- self.assertEqual(
- [
- mock.call(sem_file),
mock.call(
"/lib/modules/mykernel/"
"kernel/drivers/md/dm-thin-pool.ko"
- ),
+ )
],
exists.call_args_list,
)
else:
- ],
- exists.call_args_list,
- )
- else:
- self.assertEqual([mock.call(sem_file)], exists.call_args_list)
- del_file(sem_file)
+ if backend != "lvm":
+ self.assertEqual([], exists.call_args_list)

@mock.patch("cloudinit.config.cc_lxd.maybe_cleanup_default")
Expand All @@ -174,7 +173,7 @@ Last-Update: 2024-02-14
cc.distro = mock.MagicMock()
mock_subp.which.return_value = None
cc_lxd.handle("cc_lxd", LXD_INIT_CFG, cc, [])
@@ -118,7 +112,7 @@ class TestLxd(t_help.CiTestCase):
@@ -114,7 +102,7 @@ class TestLxd(t_help.CiTestCase):
@mock.patch("cloudinit.config.cc_lxd.maybe_cleanup_default")
@mock.patch("cloudinit.config.cc_lxd.subp")
def test_no_init_does_nothing(self, mock_subp, m_maybe_clean):
Expand All @@ -183,7 +182,7 @@ Last-Update: 2024-02-14
cc.distro = mock.MagicMock()
cc_lxd.handle("cc_lxd", {"lxd": {}}, cc, [])
self.assertFalse(cc.distro.install_packages.called)
@@ -128,17 +122,16 @@ class TestLxd(t_help.CiTestCase):
@@ -124,17 +112,16 @@ class TestLxd(t_help.CiTestCase):
@mock.patch("cloudinit.config.cc_lxd.maybe_cleanup_default")
@mock.patch("cloudinit.config.cc_lxd.subp")
def test_no_lxd_does_nothing(self, mock_subp, m_maybe_clean):
Expand All @@ -204,7 +203,7 @@ Last-Update: 2024-02-14
cc.distro = mock.MagicMock()
cc_lxd.handle(
"cc_lxd",
@@ -153,7 +146,6 @@ class TestLxd(t_help.CiTestCase):
@@ -149,7 +136,6 @@ class TestLxd(t_help.CiTestCase):
],
mock_subp.subp.call_args_list,
)
Expand Down