From ecb180c0c5a6662f26be46a9c70c9e598d942471 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 23 Mar 2016 11:26:09 +0000 Subject: [PATCH] Ignore 404 from IP address claim when IPAM is disabled --- weave | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weave b/weave index 56db8373..c8df9f12 100755 --- a/weave +++ b/weave @@ -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