From 51b2a8e7f2ded67a2c49aee62096a057db65b839 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 22 Jul 2014 12:36:32 -0700 Subject: [PATCH] command: output tainted state to CLI --- command/format_state.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/command/format_state.go b/command/format_state.go index 4a67ef7eea..a7df48291a 100644 --- a/command/format_state.go +++ b/command/format_state.go @@ -39,7 +39,14 @@ func FormatState(s *terraform.State, c *colorstring.Colorize) string { id = "" } - buf.WriteString(fmt.Sprintf("%s:\n", k)) + taintStr := "" + if s.Tainted != nil { + if _, ok := s.Tainted[id]; ok { + taintStr = " (tainted)" + } + } + + buf.WriteString(fmt.Sprintf("%s:%s\n", k, taintStr)) buf.WriteString(fmt.Sprintf(" id = %s\n", id)) // Sort the attributes