Make join exit non-zero if no nodes were joined

This commit is contained in:
Kyle Havlovitz 2017-02-08 19:45:13 -05:00
parent b35acaac33
commit 2a82804c0c
No known key found for this signature in database
GPG Key ID: 8A5E6B173056AD6C
1 changed files with 5 additions and 0 deletions

View File

@ -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( c.Ui.Output(fmt.Sprintf(
"Successfully joined cluster by contacting %d nodes.", joins)) "Successfully joined cluster by contacting %d nodes.", joins))
return 0 return 0