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 a840ac0d7c8777a8198ae40cbb79b65c5fffd7e1)
This commit is contained in:
parent
8a9def6c8f
commit
b930a68216
@ -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
|
||||
|
7
releasenotes/notes/bug-1999778.yaml
Normal file
7
releasenotes/notes/bug-1999778.yaml
Normal file
@ -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>`__
|
Loading…
x
Reference in New Issue
Block a user