File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 37
37
- [ #1751 ] ( https://github.com/influxdata/telegraf/issues/1751 ) : Fix powerdns integer parse error handling.
38
38
- [ #1752 ] ( https://github.com/influxdata/telegraf/issues/1752 ) : Fix varnish plugin defaults not being used.
39
39
- [ #1517 ] ( https://github.com/influxdata/telegraf/issues/1517 ) : Fix windows glob paths.
40
+ - [ #1137 ] ( https://github.com/influxdata/telegraf/issues/1137 ) : Fix issue loading config directory on windows.
40
41
41
42
## v1.0.1 [ unreleased]
42
43
Original file line number Diff line number Diff line change @@ -404,24 +404,21 @@ func PrintOutputConfig(name string) error {
404
404
}
405
405
406
406
func (c * Config ) LoadDirectory (path string ) error {
407
- directoryEntries , err := ioutil .ReadDir (path )
408
- if err != nil {
409
- return err
410
- }
411
- for _ , entry := range directoryEntries {
412
- if entry .IsDir () {
413
- continue
407
+ walkfn := func (thispath string , info os.FileInfo , _ error ) error {
408
+ if info .IsDir () {
409
+ return nil
414
410
}
415
- name := entry .Name ()
411
+ name := info .Name ()
416
412
if len (name ) < 6 || name [len (name )- 5 :] != ".conf" {
417
- continue
413
+ return nil
418
414
}
419
- err := c .LoadConfig (filepath . Join ( path , name ) )
415
+ err := c .LoadConfig (thispath )
420
416
if err != nil {
421
417
return err
422
418
}
419
+ return nil
423
420
}
424
- return nil
421
+ return filepath . Walk ( path , walkfn )
425
422
}
426
423
427
424
// Try to find a default config file at these locations (in order):
You can’t perform that action at this time.
0 commit comments