parent
52134555d6
commit
e19845c202
|
@ -37,6 +37,7 @@
|
||||||
- [#1751](https://github.com/influxdata/telegraf/issues/1751): Fix powerdns integer parse error handling.
|
- [#1751](https://github.com/influxdata/telegraf/issues/1751): Fix powerdns integer parse error handling.
|
||||||
- [#1752](https://github.com/influxdata/telegraf/issues/1752): Fix varnish plugin defaults not being used.
|
- [#1752](https://github.com/influxdata/telegraf/issues/1752): Fix varnish plugin defaults not being used.
|
||||||
- [#1517](https://github.com/influxdata/telegraf/issues/1517): Fix windows glob paths.
|
- [#1517](https://github.com/influxdata/telegraf/issues/1517): Fix windows glob paths.
|
||||||
|
- [#1137](https://github.com/influxdata/telegraf/issues/1137): Fix issue loading config directory on windows.
|
||||||
|
|
||||||
## v1.0.1 [unreleased]
|
## v1.0.1 [unreleased]
|
||||||
|
|
||||||
|
|
|
@ -404,24 +404,21 @@ func PrintOutputConfig(name string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Config) LoadDirectory(path string) error {
|
func (c *Config) LoadDirectory(path string) error {
|
||||||
directoryEntries, err := ioutil.ReadDir(path)
|
walkfn := func(thispath string, info os.FileInfo, _ error) error {
|
||||||
if err != nil {
|
if info.IsDir() {
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
for _, entry := range directoryEntries {
|
name := info.Name()
|
||||||
if entry.IsDir() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
name := entry.Name()
|
|
||||||
if len(name) < 6 || name[len(name)-5:] != ".conf" {
|
if len(name) < 6 || name[len(name)-5:] != ".conf" {
|
||||||
continue
|
return nil
|
||||||
}
|
}
|
||||||
err := c.LoadConfig(filepath.Join(path, name))
|
err := c.LoadConfig(thispath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
|
}
|
||||||
|
return filepath.Walk(path, walkfn)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to find a default config file at these locations (in order):
|
// Try to find a default config file at these locations (in order):
|
||||||
|
|
Loading…
Reference in New Issue