From beb15fa32ca38c19ffc9555ea83f27192867ac60 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Mon, 4 Jan 2016 10:35:44 +0000 Subject: [PATCH] don't fail `weave launch` when plugin is disabled Fixes #1851. --- weave | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/weave b/weave index 1042401f..5979d0e7 100755 --- a/weave +++ b/weave @@ -1700,8 +1700,8 @@ launch_plugin() { $PLUGIN_IMAGE "$@") } -plugin_enabled() { - [ -z $WEAVE_NO_PLUGIN ] && check_docker_server_api_version 1.21 +plugin_disabled() { + [ -n $WEAVE_NO_PLUGIN ] || ! check_docker_server_api_version 1.21 } remove_plugin_network() { @@ -1852,7 +1852,7 @@ EOF COMMON_ARGS=$(common_launch_args "$@") launch_router "$@" launch_proxy $COMMON_ARGS - plugin_enabled && launch_plugin $COMMON_ARGS + plugin_disabled || launch_plugin $COMMON_ARGS ;; launch-router) deprecation_warnings "$@" @@ -2130,7 +2130,7 @@ EOF ;; stop) [ $# -eq 0 ] || usage - plugin_enabled && stop_plugin + plugin_disabled || stop_plugin stop_router stop_proxy ;; @@ -2148,9 +2148,8 @@ EOF ;; reset) [ $# -eq 0 ] || usage - if plugin_enabled ; then - remove_plugin_network || echo "WARNING: docker may hang in this state; re-launch weave and remove attached containers before shutting down" >&2 - fi + plugin_disabled || remove_plugin_network || \ + echo "WARNING: docker may hang in this state; re-launch weave and remove attached containers before shutting down" >&2 warn_if_stopping_proxy_in_env call_weave DELETE /peer >/dev/null 2>&1 || true for NAME in $PLUGIN_CONTAINER_NAME $CONTAINER_NAME $PROXY_CONTAINER_NAME ; do