Skip to content

Commit 28a1a75

Browse files
committed
improve of-port request so it uses a common path instead of retrying on NMS managed br-ex
1 parent 5a59b6c commit 28a1a75

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

templates/common/_base/files/ofport-request.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,13 @@ contents:
5353
fi
5454
5555
# Get the port's master. If it doesn't have any, assume it's not our bridge
56-
BRIDGE_ID=$(nmcli -t -f connection.master conn show "${PORT_CONNECTION_UUID}" | awk -F ':' '{print $NF}')
56+
BRIDGE_ID=$(nmcli -t -f general.name conn show "${PORT_CONNECTION_UUID}" | awk -F ':' '{print $NF}')
5757
if [ "${BRIDGE_ID}" == "" ]; then
5858
exit 0
5959
fi
6060
6161
# Get the bridge name
62-
BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') || true
63-
if [ "${BRIDGE_NAME}" == "" ]; then
64-
#Check if br-ex is managed by nmstate (br-ex-br)
65-
PORT_CONNECTION_UUID=$(nmcli -t -f device,type,uuid conn | awk -F ':' '{if( $1=="br-ex" && $2~/^ovs-bridge/) print $NF}')
66-
BRIDGE_ID=$(nmcli -t -f connection.id conn show "${PORT_CONNECTION_UUID}" | awk -F ':' '{print $NF}')
67-
BRIDGE_NAME=$(nmcli -t -f connection.interface-name conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}')
68-
fi
62+
BRIDGE_NAME=$(nmcli -t -f connection.master conn show "${BRIDGE_ID}" | awk -F ':' '{print $NF}') || true
6963
# Limit this to br-ex and br-ex1 only. If one wanted to enable this for all OVS bridges,
7064
# the condition would be: if [ "$BRIDGE_NAME" == "" ]; then
7165
if [ "${BRIDGE_NAME}" != "br-ex" ] && [ "${BRIDGE_NAME}" != "br-ex1" ]; then

0 commit comments

Comments
 (0)