command: output tainted state to CLI

This commit is contained in:
Mitchell Hashimoto 2014-07-22 12:36:32 -07:00
parent 2b68015034
commit 51b2a8e7f2
1 changed files with 8 additions and 1 deletions

View File

@ -39,7 +39,14 @@ func FormatState(s *terraform.State, c *colorstring.Colorize) string {
id = "<not created>" id = "<not created>"
} }
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)) buf.WriteString(fmt.Sprintf(" id = %s\n", id))
// Sort the attributes // Sort the attributes