make state output match legacy output
This commit is contained in:
parent
d50956bdfc
commit
6f429cc81b
|
@ -28,8 +28,16 @@ func (s *State) String() string {
|
||||||
return "<nil>"
|
return "<nil>"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sort the modules by name for consistent output
|
||||||
|
modules := make([]string, 0, len(s.Modules))
|
||||||
|
for m := range s.Modules {
|
||||||
|
modules = append(modules, m)
|
||||||
|
}
|
||||||
|
sort.Strings(modules)
|
||||||
|
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
for _, m := range s.Modules {
|
for _, name := range modules {
|
||||||
|
m := s.Modules[name]
|
||||||
mStr := m.testString()
|
mStr := m.testString()
|
||||||
|
|
||||||
// If we're the root module, we just write the output directly.
|
// If we're the root module, we just write the output directly.
|
||||||
|
@ -51,6 +59,7 @@ func (s *State) String() string {
|
||||||
buf.WriteString(step.InstanceKey.String())
|
buf.WriteString(step.InstanceKey.String())
|
||||||
buf.WriteByte(']')
|
buf.WriteByte(']')
|
||||||
}
|
}
|
||||||
|
buf.WriteString(":")
|
||||||
}
|
}
|
||||||
buf.WriteByte('\n')
|
buf.WriteByte('\n')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue