From 2a82804c0c2dd3a3f75c982ece091e950d66e187 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Wed, 8 Feb 2017 19:45:13 -0500 Subject: [PATCH] Make join exit non-zero if no nodes were joined --- command/join.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/command/join.go b/command/join.go index 88255e54b..3ff34afc5 100644 --- a/command/join.go +++ b/command/join.go @@ -57,6 +57,11 @@ func (c *JoinCommand) Run(args []string) int { } } + if joins == 0 { + c.Ui.Error("Failed to join any nodes.") + return 1 + } + c.Ui.Output(fmt.Sprintf( "Successfully joined cluster by contacting %d nodes.", joins)) return 0