diff options
| author | Erik Panter <e.panter@mittwald.de> | 2022-12-15 13:59:56 +0100 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2023-01-16 13:25:40 +0000 |
| commit | a840ac0d7c8777a8198ae40cbb79b65c5fffd7e1 (patch) | |
| tree | 0e4a861b80abc01e482ae5fad8bbec8bc262beca | |
| parent | 7b6206294cb88609fd6ea19350d63b940748ba8e (diff) | |
| download | kolla-a840ac0d7c8777a8198ae40cbb79b65c5fffd7e1.tar.gz kolla-a840ac0d7c8777a8198ae40cbb79b65c5fffd7e1.zip | |
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
| -rw-r--r-- | docker/openvswitch/openvswitch-db-server/ovs_ensure_configured.sh | 7 | ||||
| -rw-r--r-- | releasenotes/notes/bug-1999778.yaml | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/docker/openvswitch/openvswitch-db-server/ovs_ensure_configured.sh b/docker/openvswitch/openvswitch-db-server/ovs_ensure_configured.sh index c91f87172..6fada1031 100644 --- a/docker/openvswitch/openvswitch-db-server/ovs_ensure_configured.sh +++ b/docker/openvswitch/openvswitch-db-server/ovs_ensure_configured.sh @@ -1,16 +1,15 @@ #!/bin/bash +set -o errexit bridge=$1 port=$2 -ip link show $port -if [[ $? -ne 0 ]]; then +if ! ip link show $port; then # fail when device doesn't exist exit 1 fi -ovs-vsctl br-exists $bridge -if [[ $? -eq 2 ]]; then +ovs-vsctl br-exists $bridge || if [[ $? -eq 2 ]]; then changed=changed ovs-vsctl --no-wait add-br $bridge fi diff --git a/releasenotes/notes/bug-1999778.yaml b/releasenotes/notes/bug-1999778.yaml new file mode 100644 index 000000000..bb45d0082 --- /dev/null +++ b/releasenotes/notes/bug-1999778.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixes an issue where the script ``kolla_ensure_openvswitch_configured`` in + the ``openvswitch-db-server`` image would ignore errors encountered while + configuring bridges and ports. + `LP#1999778 <https://launchpad.net/bugs/1999778>`__ |
