Skip to content

Commit

Permalink
Use default path for data.json if no other path is set (#10402)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano committed Jan 29, 2019
1 parent 5e460ed commit 1b094b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metricbeat/mb/testing/data_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func WriteEventToDataJSON(t testing.TB, fullEvent beat.Event, postfixPath string
t.Fatal(err)
}

if stat, err := os.Stat(postfixPath); err == nil && stat.IsDir() {
if stat, err := os.Stat(postfixPath); postfixPath == "" || (err == nil && stat.IsDir()) {
p = path.Join(p, postfixPath, "_meta", "data.json")
} else {
p = postfixPath
Expand Down

0 comments on commit 1b094b7

Please sign in to comment.