From f8718dcc5d584a17156483be1b92528e49a5e887 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Fri, 10 Jul 2015 16:09:43 +0000 Subject: [PATCH] Remove duplication of coverage stanza in weave script. --- weave | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/weave b/weave index 625e2ec0..f69bcb9a 100755 --- a/weave +++ b/weave @@ -181,7 +181,10 @@ DNS_HTTP_PORT=6785 DNS_HTTP_IFNAME=eth0 PROXY_PORT=12375 PROXY_CONTAINER_NAME=weaveproxy - +COVERAGE_ARGS="" +if [ -n "$COVERAGE" ] ; then + COVERAGE_ARGS="-test.coverprofile=/home/weave/cover.router.prof --" +fi ###################################################################### # general helpers; independent of docker and weave @@ -413,11 +416,11 @@ ask_version() { echo "Unable to find $2 image." >&2 fi fi - COVERAGE_ARGS="" - if [ -n "$COVERAGE" -a "$1" = "$CONTAINER_NAME" ] ; then - COVERAGE_ARGS="-test.coverprofile=/home/weave/cover.router.prof --" + VERSION_COVERAGE_ARGS="" + if [ "$1" = "$CONTAINER_NAME" ] ; then + VERSION_COVERAGE_ARGS="$COVERAGE_ARGS" fi - [ -n "$DOCKERIMAGE" ] && docker run --rm -e WEAVE_CIDR=none $DOCKERIMAGE $COVERAGE_ARGS --version + [ -n "$DOCKERIMAGE" ] && docker run --rm -e WEAVE_CIDR=none $DOCKERIMAGE $VERSION_COVERAGE_ARGS --version } ###################################################################### @@ -1042,10 +1045,6 @@ launch_router() { exit 1 fi fi - COVERAGE_ARGS="" - if [ -n "$COVERAGE" ] ; then - COVERAGE_ARGS="-test.coverprofile=/home/weave/cover.router.prof --" - fi # Set WEAVE_DOCKER_ARGS in the environment in order to supply # additional parameters, such as resource limits, to docker # when launching the weave container.