Merge "Ensure interface exists before adding OVS port"

This commit is contained in:
Jenkins 2017-08-31 12:11:12 +00:00 committed by Gerrit Code Review
commit a04bd8d29e

@ -3,8 +3,14 @@
bridge=$1
port=$2
ovs-vsctl br-exists $bridge; rc=$?
if [[ $rc == 2 ]]; then
ip link show $port
if [[ $? -ne 0 ]]; then
# fail when device doesn't exist
exit 1
fi
ovs-vsctl br-exists $bridge
if [[ $? -eq 2 ]]; then
changed=changed
ovs-vsctl --no-wait add-br $bridge
fi