Merge pull request #2657 from weaveworks/remove-bridge-on-error

Remove weave bridge if something goes wrong when creating it
This commit is contained in:
Adam Harrison authored and GitHub committed 2016-12-06 11:41:29 +00:00
commit 597c6c111d
1 file changed
+11 -1
+11 -1
View File
@@ -571,7 +571,7 @@ detect_bridge_type() {
MTU=${WEAVE_MTU:-$(cat /sys/class/net/$BRIDGE/mtu)}
}
create_bridge() {
try_create_bridge() {
if ! detect_bridge_type ; then
BRIDGE_TYPE=bridge
if [ -z "$WEAVE_NO_FASTDP" ] ; then
@@ -656,6 +656,16 @@ EOF
configure_arp_cache $BRIDGE
}
create_bridge() {
if ! try_create_bridge "$@" ; then
echo "Creating bridge '$BRIDGE' failed" >&2
# reset to original value so we destroy both kinds
DATAPATH=datapath
destroy_bridge
exit 1
fi
}
expose_ip() {
ipam_cidrs allocate_no_check_alive weave:expose $CIDR_ARGS
for CIDR in $ALL_CIDRS ; do