From a6c2bc3790be8170c5ba6a66f8cc0c68d70235a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Thu, 7 May 2026 03:06:41 -0300 Subject: [PATCH] fix: use connection UUID in bridge slave setup to handle spaces in NM profile names NetworkManager can auto-generate connection names with spaces (e.g. "Wired connection 2"). The bridge slave setup in create_bridge_interface_nmcli stored this name in a variable that was later expanded unquoted in nmcli commands, breaking both the initial con mod and all downstream operations (con up, con delete on rollback). Resolve the connection to its UUID before use, which is space-safe and valid for all nmcli operations. Closes: #7483 --- xCAT/postscripts/nicutils.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 48c387ed9..7b21a3b08 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -2035,8 +2035,10 @@ function create_bridge_interface_nmcli { fi con_use_same_dev=$(wait_nic_connect_intime $_port) if [ "$con_use_same_dev" != "--" -a -n "$con_use_same_dev" ]; then - cmd="$nmcli con mod "$con_use_same_dev" master $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1 connection.autoconnect-retries 0" - xcat_slave_con=$con_use_same_dev + # Resolve to UUID since connection names can contain spaces (e.g. "Wired connection 2") + con_uuid=$($nmcli --get-values connection.uuid c show "$con_use_same_dev") + cmd="$nmcli con mod $con_uuid master $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1 connection.autoconnect-retries 0" + xcat_slave_con=$con_uuid else cmd="$nmcli con add type $_pretype con-name $xcat_slave_con ifname $_port master $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1 connection.autoconnect-retries 0" fi