From 059493b5874c2e70e04a9d52ced6e32f05e66b58 Mon Sep 17 00:00:00 2001 From: Calvin Leung Huang Date: Thu, 5 Apr 2018 12:54:15 -0400 Subject: [PATCH] Do not fail if api_addr and cluster_addr are empty (#4286) --- command/server.go | 2 +- command/server_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/command/server.go b/command/server.go index fde59a607c..255b457857 100644 --- a/command/server.go +++ b/command/server.go @@ -597,7 +597,7 @@ func (c *ServerCommand) Run(args []string) int { CLUSTER_SYNTHESIS_COMPLETE: - if coreConfig.RedirectAddr == coreConfig.ClusterAddr { + if coreConfig.RedirectAddr == coreConfig.ClusterAddr && len(coreConfig.RedirectAddr) != 0 { c.UI.Error(fmt.Sprintf( "Address %q used for both API and cluster addresses", coreConfig.RedirectAddr)) return 1 diff --git a/command/server_test.go b/command/server_test.go index c15cf0596f..2e2e180112 100644 --- a/command/server_test.go +++ b/command/server_test.go @@ -147,7 +147,8 @@ func TestServer_ReloadListener(t *testing.T) { args := []string{"-config", td + "/reload.hcl"} go func() { if code := cmd.Run(args); code != 0 { - t.Error("got a non-zero exit status") + output := ui.ErrorWriter.String() + ui.OutputWriter.String() + t.Errorf("got a non-zero exit status: %s", output) } finishedMutex.Lock() finished = true