From ac3578a0bc0e6659223bd27892344389a212d50b Mon Sep 17 00:00:00 2001 From: Josh Grancell Date: Wed, 6 Nov 2019 19:26:32 -0500 Subject: [PATCH] command/output: Absence of outputs is not an error --- command/output.go | 2 +- command/output_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/command/output.go b/command/output.go index c2c0fd672..ac07764c7 100644 --- a/command/output.go +++ b/command/output.go @@ -120,7 +120,7 @@ func (c *OutputCommand) Run(args []string) int { "become available. If you are using interpolation, please verify\n" + "the interpolated value is not empty. You can use the \n" + "`terraform console` command to assist.") - return 1 + return 0 } if name == "" { diff --git a/command/output_test.go b/command/output_test.go index dd447c60f..cbb03ddf8 100644 --- a/command/output_test.go +++ b/command/output_test.go @@ -136,7 +136,7 @@ func TestOutput_emptyOutputsErr(t *testing.T) { args := []string{ "-state", statePath, } - if code := c.Run(args); code != 1 { + if code := c.Run(args); code != 0 { t.Fatalf("bad: \n%s", ui.ErrorWriter.String()) } } @@ -292,7 +292,7 @@ func TestOutput_noArgs(t *testing.T) { } args := []string{} - if code := c.Run(args); code != 1 { + if code := c.Run(args); code != 0 { t.Fatalf("bad: \n%s", ui.OutputWriter.String()) } } @@ -313,7 +313,7 @@ func TestOutput_noState(t *testing.T) { "-state", statePath, "foo", } - if code := c.Run(args); code != 1 { + if code := c.Run(args); code != 0 { t.Fatalf("bad: \n%s", ui.ErrorWriter.String()) } } @@ -335,7 +335,7 @@ func TestOutput_noVars(t *testing.T) { "-state", statePath, "bar", } - if code := c.Run(args); code != 1 { + if code := c.Run(args); code != 0 { t.Fatalf("bad: \n%s", ui.ErrorWriter.String()) } }