From 5106317e5dfdb0aa8e474a1f096ae90d0afa8391 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 26 May 2017 15:19:21 +0000 Subject: [PATCH] Remove deprecated --init-peer-count option Since this was the last deprecated option, remove all code to generate deprecation warnings in the weave script. --- prog/weaver/main.go | 5 +---- weave | 26 -------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/prog/weaver/main.go b/prog/weaver/main.go index 4a6f1f37..d2c72533 100644 --- a/prog/weaver/main.go +++ b/prog/weaver/main.go @@ -66,9 +66,7 @@ func (c *ipamConfig) Enabled() bool { case !hasRange && hasSubnet: Log.Fatal("--ipalloc-default-subnet specified without --ipalloc-range.") case !hasRange: - Log.Fatal("--ipalloc-init or --init-peer-count specified without --ipalloc-range.") - case hasMode && hasPeerCount: - Log.Fatal("At most one of --ipalloc-init or --init-peer-count may be specified.") + Log.Fatal("--ipalloc-init specified without --ipalloc-range.") } if hasMode { if err := c.parseMode(); err != nil { @@ -187,7 +185,6 @@ func main() { mflag.StringVar(&ipamConfig.Mode, []string{"-ipalloc-init"}, "", "allocator initialisation strategy (consensus, seed or observer)") mflag.StringVar(&ipamConfig.IPRangeCIDR, []string{"-ipalloc-range"}, "", "IP address range reserved for automatic allocation, in CIDR notation") mflag.StringVar(&ipamConfig.IPSubnetCIDR, []string{"-ipalloc-default-subnet"}, "", "subnet to allocate within by default, in CIDR notation") - mflag.IntVar(&ipamConfig.PeerCount, []string{"-init-peer-count"}, 0, "number of peers in network (for IP address allocation)") mflag.StringVar(&dockerAPI, []string{"-docker-api"}, defaultDockerHost, "Docker API endpoint") mflag.BoolVar(&noDNS, []string{"-no-dns"}, false, "disable DNS server") mflag.StringVar(&dnsConfig.Domain, []string{"-dns-domain"}, nameserver.DefaultDomain, "local domain to server requests for") diff --git a/weave b/weave index 2389f6ef..fb9958ec 100755 --- a/weave +++ b/weave @@ -1305,31 +1305,6 @@ protect_against_docker_hang() { rm -f $HOST_ROOT/run/docker/plugins/weave.sock $HOST_ROOT/run/docker/plugins/weavemesh.sock } -###################################################################### -# argument deprecation handling -###################################################################### - -deprecation_warning() { - echo "Warning: ${1%=*} is deprecated; please use $2" >&2 -} - -deprecation_warnings() { - while [ $# -gt 0 ]; do - case "$1" in - # Flags that have a following argument which should not be inspected - --password|--nickname|--ipalloc-range|--ipalloc-default-subnet) - shift - ;; - --init-peer-count|--init-peer-count=*) - deprecation_warning $1 "--ipalloc-init consensus=" - [ ${1#--} = "init-peer-count" ] && shift - shift - ;; - esac - shift - done -} - ###################################################################### # main (remote and --local) ###################################################################### @@ -1393,7 +1368,6 @@ case "$COMMAND" in detect_bridge_type && echo $BRIDGE_TYPE ;; launch) - deprecation_warnings "$@" check_not_running router $CONTAINER_NAME $BASE_IMAGE if http_call $HTTP_ADDR GET /status >/dev/null 2>&1 ; then echo "Weave Net is already running" >&2