command/output: Absence of outputs is not an error
This commit is contained in:
parent
21228b473a
commit
ac3578a0bc
|
@ -120,7 +120,7 @@ func (c *OutputCommand) Run(args []string) int {
|
||||||
"become available. If you are using interpolation, please verify\n" +
|
"become available. If you are using interpolation, please verify\n" +
|
||||||
"the interpolated value is not empty. You can use the \n" +
|
"the interpolated value is not empty. You can use the \n" +
|
||||||
"`terraform console` command to assist.")
|
"`terraform console` command to assist.")
|
||||||
return 1
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if name == "" {
|
if name == "" {
|
||||||
|
|
|
@ -136,7 +136,7 @@ func TestOutput_emptyOutputsErr(t *testing.T) {
|
||||||
args := []string{
|
args := []string{
|
||||||
"-state", statePath,
|
"-state", statePath,
|
||||||
}
|
}
|
||||||
if code := c.Run(args); code != 1 {
|
if code := c.Run(args); code != 0 {
|
||||||
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
|
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,7 @@ func TestOutput_noArgs(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
args := []string{}
|
args := []string{}
|
||||||
if code := c.Run(args); code != 1 {
|
if code := c.Run(args); code != 0 {
|
||||||
t.Fatalf("bad: \n%s", ui.OutputWriter.String())
|
t.Fatalf("bad: \n%s", ui.OutputWriter.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,7 @@ func TestOutput_noState(t *testing.T) {
|
||||||
"-state", statePath,
|
"-state", statePath,
|
||||||
"foo",
|
"foo",
|
||||||
}
|
}
|
||||||
if code := c.Run(args); code != 1 {
|
if code := c.Run(args); code != 0 {
|
||||||
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
|
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -335,7 +335,7 @@ func TestOutput_noVars(t *testing.T) {
|
||||||
"-state", statePath,
|
"-state", statePath,
|
||||||
"bar",
|
"bar",
|
||||||
}
|
}
|
||||||
if code := c.Run(args); code != 1 {
|
if code := c.Run(args); code != 0 {
|
||||||
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
|
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue