Skip to content

Commit b930a68

Browse files
epanter-mwmmalchuk
authored andcommitted
relay non-zero exit codes when creating openvswitch bridges
Calls to `ovs-vsctl` in `ovs_ensure_configured.sh` did not get checked for errors. This can cause false success statuses when the script is run by automation tools such as ansible. Depends-On: https://review.opendev.org/c/openstack/kolla-ansible/+/870540 Closes-bug: #1999778 Change-Id: Iad83132b61efadbf09aa9aa2edf96235085764c6 (cherry picked from commit a840ac0)
1 parent 8a9def6 commit b930a68

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

docker/openvswitch/openvswitch-db-server/ovs_ensure_configured.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
#!/bin/bash
2+
set -o errexit
23

34
bridge=$1
45
port=$2
56

6-
ip link show $port
7-
if [[ $? -ne 0 ]]; then
7+
if ! ip link show $port; then
88
# fail when device doesn't exist
99
exit 1
1010
fi
1111

12-
ovs-vsctl br-exists $bridge
13-
if [[ $? -eq 2 ]]; then
12+
ovs-vsctl br-exists $bridge || if [[ $? -eq 2 ]]; then
1413
changed=changed
1514
ovs-vsctl --no-wait add-br $bridge
1615
fi
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
Fixes an issue where the script ``kolla_ensure_openvswitch_configured`` in
5+
the ``openvswitch-db-server`` image would ignore errors encountered while
6+
configuring bridges and ports.
7+
`LP#1999778 <https://launchpad.net/bugs/1999778>`__

0 commit comments

Comments
 (0)