Fix exec input legacy behavior, command=''

This commit is contained in:
Cameron Sparr 2016-02-09 11:14:36 -07:00
parent 893357f01e
commit d551da26e5
1 changed files with 6 additions and 0 deletions

View File

@ -101,6 +101,12 @@ func (e *Exec) SetParser(parser parsers.Parser) {
} }
func (e *Exec) Gather(acc telegraf.Accumulator) error { func (e *Exec) Gather(acc telegraf.Accumulator) error {
// Legacy single command support
if e.Command != "" {
e.Commands = append(e.Commands, e.Command)
e.Command = ""
}
e.errChan = make(chan error, len(e.Commands)) e.errChan = make(chan error, len(e.Commands))
e.wg.Add(len(e.Commands)) e.wg.Add(len(e.Commands))