Skip to content

Commit

Permalink
core: Update terraform show to deal with lists
Browse files Browse the repository at this point in the history
Fixes #6931.
  • Loading branch information
jen20 committed May 31, 2016
1 parent 4820512 commit c96a8d5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion command/format_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,17 @@ func FormatState(opts *FormatStateOpts) string {
// Output each output k/v pair
for _, k := range ks {
v := m.Outputs[k]
buf.WriteString(fmt.Sprintf("%s = %s\n", k, v))
switch output := v.Value.(type) {
case string:
buf.WriteString(fmt.Sprintf("%s = %s", k, output))
buf.WriteString("\n")
case []interface{}:
buf.WriteString(formatListOutput("", k, output))
buf.WriteString("\n")
case map[string]interface{}:
buf.WriteString(formatMapOutput("", k, output))
buf.WriteString("\n")
}
}
}

Expand Down

0 comments on commit c96a8d5

Please sign in to comment.