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..e062725 --- /dev/null +++ b/ci-fix-NM-reload-and-bring-up-individual-network-conns-.patch @@ -0,0 +1,69 @@ +From 486e0dcb6e612b38e7dcc2bcfa905ab9a39a0387 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: 126: fix: NM reload and bring up individual network conns (#6073) +RH-Jira: RHEL-81896 +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Acked-by: xiachen +RH-Commit: [1/1] 857425551179297a53fe8c870f055ad832085d36 (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.39.3 + diff --git a/cloud-init.spec b/cloud-init.spec index 9e042bd..04b6bae 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -6,7 +6,7 @@ Name: cloud-init Version: 24.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Cloud instance init scripts License: Apache-2.0 OR GPL-3.0-only URL: https://github.com/canonical/cloud-init @@ -24,6 +24,8 @@ Patch7: 0001-downstream-Created-.distro-directory.patch Patch8: ci-Use-log_with_downgradable_level-for-user-password-wa.patch # For RHEL-79727 - [c10s] cloud-init remove 'NOZEROCONF=yes' from /etc/sysconfig/network Patch9: ci-net-sysconfig-do-not-remove-all-existing-settings-of.patch +# For RHEL-81896 - DataSourceNoCloudNet network configuration is ineffective [rhel-10] +Patch10: ci-fix-NM-reload-and-bring-up-individual-network-conns-.patch BuildArch: noarch @@ -229,6 +231,11 @@ fi %changelog +* Tue Mar 18 2025 Miroslav Rezanina - 24.4-4 +- ci-fix-NM-reload-and-bring-up-individual-network-conns-.patch [RHEL-81896] +- Resolves: RHEL-81896 + (DataSourceNoCloudNet network configuration is ineffective [rhel-10]) + * Mon Feb 17 2025 Miroslav Rezanina - 24.4-3 - ci-Use-log_with_downgradable_level-for-user-password-wa.patch [RHEL-73667] - ci-net-sysconfig-do-not-remove-all-existing-settings-of.patch [RHEL-79727]