From 108d62a5a1b6501006145606830ad3d8432bae70 Mon Sep 17 00:00:00 2001 From: Jack Morris Date: Sat, 27 Apr 2019 11:55:19 +0100 Subject: [PATCH] Fix False Error when no Outputs are Defined Addresses #18975 -- terraform returns an error when there are no outputs defined --- command/output.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command/output.go b/command/output.go index 789be53a40bd..a44e20f75dd7 100644 --- a/command/output.go +++ b/command/output.go @@ -112,14 +112,14 @@ func (c *OutputCommand) Run(args []string) int { } if !jsonOutput && (state.Empty() || len(mod.OutputValues) == 0) { - c.Ui.Error( + c.Ui.Output( "The state file either has no outputs defined, or all the defined\n" + "outputs are empty. Please define an output in your configuration\n" + "with the `output` keyword and run `terraform refresh` for it to\n" + "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 == "" {