diff --git a/ci-fix-NM-reload-and-bring-up-individual-network-conns-.patch b/ci-fix-NM-reload-and-bring-up-individual-network-conns-.patch new file mode 100644 index 0000000..a3c2f6c --- /dev/null +++ b/ci-fix-NM-reload-and-bring-up-individual-network-conns-.patch @@ -0,0 +1,67 @@ +From 95e9d95a1bd0b995cdb505395b761896739d1476 Mon Sep 17 00:00:00 2001 +From: Ani Sinha +Date: Thu, 13 Mar 2025 19:46:35 +0530 +Subject: [PATCH] fix: NM reload and bring up individual network conns (#6073) + +RH-Author: Ani Sinha +RH-MergeRequest: 125: fix: NM reload and bring up individual network conns (#6073) +RH-Jira: RHEL-81703 +RH-Commit: [1/1] 7d9b3575e1807360c40a1f45620060d1843a65b7 (anisinha/cloud-init) + +Reloading the network manager service is equivalent to "nmcli reload" and this +command only reloads the global .conf files and DNS config, not connections. +This means changes to connection files will not take effect. For those to take +effect, we need "nmcli conn load/reload" and then "nmcli conn up". Thus, +reloading network manager as well as reloading the connections are required to +cover all cases. + +Also see https://github.com/canonical/cloud-init/issues/5512#issuecomment-2298371744 + +While at it, rename "reload-or-try-restart" -> "try-reload-or-restart" since +the former is legacy and the later is the officially documented sub-command. + +Fixes: GH-6064 +Fixes: bde913ae242 ("fix(NetworkManager): Fix network activator") + +Signed-off-by: Ani Sinha +(cherry picked from commit 671baf22df846bcc2cfecf3d2c0e09a816fbf240) +Signed-off-by: Ani Sinha +--- + cloudinit/net/activators.py | 4 ++-- + tests/unittests/test_net_activators.py | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/cloudinit/net/activators.py b/cloudinit/net/activators.py +index de9a1d3c9..942128941 100644 +--- a/cloudinit/net/activators.py ++++ b/cloudinit/net/activators.py +@@ -206,9 +206,9 @@ class NetworkManagerActivator(NetworkActivator): + state, + ) + return _alter_interface( +- ["systemctl", "reload-or-try-restart", "NetworkManager.service"], ++ ["systemctl", "try-reload-or-restart", "NetworkManager.service"], + "all", +- ) ++ ) and all(cls.bring_up_interface(device) for device in device_names) + + + class NetplanActivator(NetworkActivator): +diff --git a/tests/unittests/test_net_activators.py b/tests/unittests/test_net_activators.py +index a720ada81..84876b73b 100644 +--- a/tests/unittests/test_net_activators.py ++++ b/tests/unittests/test_net_activators.py +@@ -247,8 +247,8 @@ NETWORK_MANAGER_BRING_UP_ALL_CALL_LIST: list = [ + ), + {}, + ), +- ((["systemctl", "reload-or-try-restart", "NetworkManager.service"],), {}), +-] ++ ((["systemctl", "try-reload-or-restart", "NetworkManager.service"],), {}), ++] + NETWORK_MANAGER_BRING_UP_CALL_LIST + + NETWORKD_BRING_UP_CALL_LIST: list = [ + ((["ip", "link", "set", "dev", "eth0", "up"],), {}), +-- +2.48.1 + diff --git a/cloud-init.spec b/cloud-init.spec index d468b28..2986d7b 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,6 +1,6 @@ Name: cloud-init Version: 24.4 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Cloud instance init scripts License: ASL 2.0 or GPLv3 URL: http://launchpad.net/cloud-init @@ -21,6 +21,8 @@ Patch7: ci-Use-log_with_downgradable_level-for-user-password-wa.patch Patch8: ci-downstream-set-deprecation-boundary-version.patch # For RHEL-76361 - [c9s] cloud-init remove 'NOZEROCONF=yes' from /etc/sysconfig/network Patch9: ci-net-sysconfig-do-not-remove-all-existing-settings-of.patch +# For RHEL-81703 - DataSourceNoCloudNet network configuration is ineffective - c9s +Patch10: ci-fix-NM-reload-and-bring-up-individual-network-conns-.patch BuildArch: noarch @@ -235,6 +237,11 @@ fi %config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf %changelog +* Tue Mar 18 2025 Jon Maloy - 24.4-5 +- ci-fix-NM-reload-and-bring-up-individual-network-conns-.patch [RHEL-81703] +- Resolves: RHEL-81703 + (DataSourceNoCloudNet network configuration is ineffective - c9s) + * Mon Feb 17 2025 Jon Maloy - 24.4-4 - ci-net-sysconfig-do-not-remove-all-existing-settings-of.patch [RHEL-76361] - Resolves: RHEL-76361