From a7be3066c4ef4e8332e2ee0082a30663a92a0a1e Mon Sep 17 00:00:00 2001 From: Emilia Desch Date: Wed, 24 Sep 2025 14:19:13 +0200 Subject: [PATCH 1/5] ofport-request dispatcher script takes br-ex(-br) managed by nmstate into account --- templates/common/_base/files/ofport-request.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/common/_base/files/ofport-request.yaml b/templates/common/_base/files/ofport-request.yaml index 36465e218e..8336c1ec63 100644 --- a/templates/common/_base/files/ofport-request.yaml +++ b/templates/common/_base/files/ofport-request.yaml @@ -59,7 +59,13 @@ contents: fi # Get the bridge name - BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') + BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') || true + if [ "${BRIDGE_NAME}" == "" ]; then + #Check if br-ex is managed by nmstate (br-ex-br) + PORT_CONNECTION_UUID=$(nmcli -t -f device,type,uuid conn | awk -F ':' '{if( $1=="br-ex" && $2~/^ovs-bridge/) print $NF}') + BRIDGE_ID=$(nmcli -t -f connection.id conn show "${PORT_CONNECTION_UUID}" | awk -F ':' '{print $NF}') + BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') + fi # Limit this to br-ex and br-ex1 only. If one wanted to enable this for all OVS bridges, # the condition would be: if [ "$BRIDGE_NAME" == "" ]; then if [ "${BRIDGE_NAME}" != "br-ex" ] && [ "${BRIDGE_NAME}" != "br-ex1" ]; then From 8c16324eef216f9b30cb2877b44a6d123877e909 Mon Sep 17 00:00:00 2001 From: Emilia Desch Date: Tue, 30 Sep 2025 12:31:11 +0200 Subject: [PATCH 2/5] improve of-port request so it uses a common path instead of retrying on NMS managed br-ex --- templates/common/_base/files/ofport-request.yaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/templates/common/_base/files/ofport-request.yaml b/templates/common/_base/files/ofport-request.yaml index 8336c1ec63..4fc301b02d 100644 --- a/templates/common/_base/files/ofport-request.yaml +++ b/templates/common/_base/files/ofport-request.yaml @@ -53,19 +53,13 @@ contents: fi # Get the port's master. If it doesn't have any, assume it's not our bridge - BRIDGE_ID=$(nmcli -t -f connection.master conn show "${PORT_CONNECTION_UUID}" | awk -F ':' '{print $NF}') + BRIDGE_ID=$(nmcli -t -f general.name conn show "${PORT_CONNECTION_UUID}" | awk -F ':' '{print $NF}') if [ "${BRIDGE_ID}" == "" ]; then exit 0 fi # Get the bridge name - BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') || true - if [ "${BRIDGE_NAME}" == "" ]; then - #Check if br-ex is managed by nmstate (br-ex-br) - PORT_CONNECTION_UUID=$(nmcli -t -f device,type,uuid conn | awk -F ':' '{if( $1=="br-ex" && $2~/^ovs-bridge/) print $NF}') - BRIDGE_ID=$(nmcli -t -f connection.id conn show "${PORT_CONNECTION_UUID}" | awk -F ':' '{print $NF}') - BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') - fi + BRIDGE_NAME=$(nmcli -t -f connection.master conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') || true # Limit this to br-ex and br-ex1 only. If one wanted to enable this for all OVS bridges, # the condition would be: if [ "$BRIDGE_NAME" == "" ]; then if [ "${BRIDGE_NAME}" != "br-ex" ] && [ "${BRIDGE_NAME}" != "br-ex1" ]; then From bd161e7cf909905de8c5c8c4ef618b4675f945dc Mon Sep 17 00:00:00 2001 From: Emilia Desch Date: Thu, 9 Oct 2025 17:58:22 +0200 Subject: [PATCH 3/5] Revert "improve of-port request so it uses a common path instead of retrying on NMS managed br-ex" This reverts commit 28a1a758087a6b22cc6f0facbd5e770eac00d90f. --- templates/common/_base/files/ofport-request.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/common/_base/files/ofport-request.yaml b/templates/common/_base/files/ofport-request.yaml index 4fc301b02d..8336c1ec63 100644 --- a/templates/common/_base/files/ofport-request.yaml +++ b/templates/common/_base/files/ofport-request.yaml @@ -53,13 +53,19 @@ contents: fi # Get the port's master. If it doesn't have any, assume it's not our bridge - BRIDGE_ID=$(nmcli -t -f general.name conn show "${PORT_CONNECTION_UUID}" | awk -F ':' '{print $NF}') + BRIDGE_ID=$(nmcli -t -f connection.master conn show "${PORT_CONNECTION_UUID}" | awk -F ':' '{print $NF}') if [ "${BRIDGE_ID}" == "" ]; then exit 0 fi # Get the bridge name - BRIDGE_NAME=$(nmcli -t -f connection.master conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') || true + BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') || true + if [ "${BRIDGE_NAME}" == "" ]; then + #Check if br-ex is managed by nmstate (br-ex-br) + PORT_CONNECTION_UUID=$(nmcli -t -f device,type,uuid conn | awk -F ':' '{if( $1=="br-ex" && $2~/^ovs-bridge/) print $NF}') + BRIDGE_ID=$(nmcli -t -f connection.id conn show "${PORT_CONNECTION_UUID}" | awk -F ':' '{print $NF}') + BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') + fi # Limit this to br-ex and br-ex1 only. If one wanted to enable this for all OVS bridges, # the condition would be: if [ "$BRIDGE_NAME" == "" ]; then if [ "${BRIDGE_NAME}" != "br-ex" ] && [ "${BRIDGE_NAME}" != "br-ex1" ]; then From 8872af0f20dab203e38adda7e84c69ff211b08e9 Mon Sep 17 00:00:00 2001 From: Emilia Desch Date: Thu, 9 Oct 2025 17:58:47 +0200 Subject: [PATCH 4/5] Revert "ofport-request dispatcher script takes br-ex(-br) managed by nmstate into account" This reverts commit 5a59b6c2874d2aed6a224026848f1b307277d1ce. --- templates/common/_base/files/ofport-request.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/templates/common/_base/files/ofport-request.yaml b/templates/common/_base/files/ofport-request.yaml index 8336c1ec63..36465e218e 100644 --- a/templates/common/_base/files/ofport-request.yaml +++ b/templates/common/_base/files/ofport-request.yaml @@ -59,13 +59,7 @@ contents: fi # Get the bridge name - BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') || true - if [ "${BRIDGE_NAME}" == "" ]; then - #Check if br-ex is managed by nmstate (br-ex-br) - PORT_CONNECTION_UUID=$(nmcli -t -f device,type,uuid conn | awk -F ':' '{if( $1=="br-ex" && $2~/^ovs-bridge/) print $NF}') - BRIDGE_ID=$(nmcli -t -f connection.id conn show "${PORT_CONNECTION_UUID}" | awk -F ':' '{print $NF}') - BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') - fi + BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') # Limit this to br-ex and br-ex1 only. If one wanted to enable this for all OVS bridges, # the condition would be: if [ "$BRIDGE_NAME" == "" ]; then if [ "${BRIDGE_NAME}" != "br-ex" ] && [ "${BRIDGE_NAME}" != "br-ex1" ]; then From f1f8d6f086cb30641265629cb9f07e93f20c64f3 Mon Sep 17 00:00:00 2001 From: Emilia Desch Date: Thu, 9 Oct 2025 19:07:57 +0200 Subject: [PATCH 5/5] add: fallback check for br-ex-br in ofport NM dispatcher script --- templates/common/_base/files/ofport-request.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/common/_base/files/ofport-request.yaml b/templates/common/_base/files/ofport-request.yaml index 36465e218e..2a1f23ed9b 100644 --- a/templates/common/_base/files/ofport-request.yaml +++ b/templates/common/_base/files/ofport-request.yaml @@ -59,9 +59,13 @@ contents: fi # Get the bridge name - BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') + BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') || true # Limit this to br-ex and br-ex1 only. If one wanted to enable this for all OVS bridges, # the condition would be: if [ "$BRIDGE_NAME" == "" ]; then + # OCPBUGS-54682: If the condition is not met the first time it will check for br-ex-br to see if there is a K-NMS managed br-ex. + if [ "${BRIDGE_NAME}" != "br-ex" ] && [ "${BRIDGE_NAME}" != "br-ex1" ]; then + BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "br-ex-br" | awk -F ':' '{print $NF}') + fi if [ "${BRIDGE_NAME}" != "br-ex" ] && [ "${BRIDGE_NAME}" != "br-ex1" ]; then exit 0 fi