Ignore 404 from IP address claim when IPAM is disabled

This commit is contained in:
Bryan Boreham committed 2016-04-05 17:54:18 +01:00
1 parent f01d91459b
commit ecb180c0c5
1 file changed
+2 -1
+2 -1
View File
@@ -1400,7 +1400,8 @@ ipam_cidrs() {
if [ "$METHOD" = "POST" ] ; then
# Assignment of a plain IP address; warn if it clashes but carry on
check_overlap $arg || true
when_weave_running http_call $HTTP_ADDR PUT /ip/$CONTAINER_ID/$arg || return 1
# Abort on failure, but not 4 (=404), which means IPAM is disabled
when_weave_running http_call $HTTP_ADDR PUT /ip/$CONTAINER_ID/$arg || [ $? -eq 4 ] || return 1
fi
ALL_CIDRS="$ALL_CIDRS $arg"
fi