Merge "Ensure interface exists before adding OVS port"
This commit is contained in:
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user