Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Simplify detection of issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bboreham committed Sep 22, 2015
1 parent 98b80c5 commit abf13c7
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions weave
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,9 @@ ipam_cidrs() {
if [ "$IPAM_CIDRS" = "404 page not found" ] ; then
echo "No IP address supplied (use the -iprange option on 'weave launch' to enable IP address allocation)" >&2
return 1
elif [ "$IPAM_CIDRS" = "cancelled" ] ; then
return 0
elif ! is_cidr "$IPAM_CIDRS" ; then
echo "$IPAM_CIDRS" >&2
return 1
fi
ALL_CIDRS="$IPAM_CIDRS"
fi
Expand All @@ -935,8 +936,6 @@ ipam_cidrs() {
if [ "$CIDR" = "404 page not found" ] ; then
echo "IP address allocation must be enabled to use 'net:'" >&2
return 1
elif [ "$CIDR" = "cancelled" ] ; then
return 0
elif ! is_cidr "$CIDR" ; then
echo "$CIDR" >&2
return 1
Expand Down Expand Up @@ -1489,10 +1488,6 @@ case "$COMMAND" in
CONTAINER=$(container_id $1)
create_bridge
ipam_cidrs$ATTACH_TYPE $CONTAINER $CIDR_ARGS
if [ "$IPAM_CIDRS" = "cancelled" ] ; then
echo "cancelled" >&2
exit 0
fi
if [ -n "$REWRITE_HOSTS" ] && command_exists weavehosts ; then
PATH_AND_NAME=$(docker inspect -f '{{.HostsPath}} {{.Config.Hostname}}' $CONTAINER)
weavehosts $PATH_AND_NAME $ALL_CIDRS
Expand Down

0 comments on commit abf13c7

Please sign in to comment.