Skip to content

Commit

Permalink
let actions tests run this
Browse files Browse the repository at this point in the history
  • Loading branch information
adamancini committed Sep 18, 2023
1 parent 357504e commit 3f1d50a
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions pkg/collect/host_filesystem_performance_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,26 @@ func collectHostFilesystemPerformance(hostCollector *troubleshootv1beta2.Filesys
return nil, errors.Wrapf(err, "failed to mkdir %q", hostCollector.Directory)
}

filename := filepath.Join(hostCollector.Directory, fioJobOptions.Name)
// Create file handle
f, err := os.OpenFile(filename, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0600)
if err != nil {
if os.IsPermission(err) {
return nil, errors.Wrapf(err, "open %s permission denied; please run this collector as root", filename)
} else if os.IsNotExist(err) {
return nil, errors.Wrapf(err, "open %s no such file or directory", filename)
} else {
return nil, errors.Wrapf(err, "open %s for writing failed", filename)
}
}
defer func() {
if err := f.Close(); err != nil {
log.Println(err.Error())
}
if err := os.Remove(filename); err != nil {
log.Println(err.Error())
}
}()
// filename := filepath.Join(hostCollector.Directory, fioJobOptions.Name)
// // Create file handle
// f, err := os.OpenFile(filename, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0600)
// if err != nil {
// if os.IsPermission(err) {
// return nil, errors.Wrapf(err, "open %s permission denied; please run this collector as root", filename)
// } else if os.IsNotExist(err) {
// return nil, errors.Wrapf(err, "open %s no such file or directory", filename)
// } else {
// return nil, errors.Wrapf(err, "open %s for writing failed", filename)
// }
// }
// defer func() {
// if err := f.Close(); err != nil {
// log.Println(err.Error())
// }
// if err := os.Remove(filename); err != nil {
// log.Println(err.Error())
// }
// }()

// Start the background IOPS task and wait for warmup
if hostCollector.EnableBackgroundIOPS {
Expand Down

0 comments on commit 3f1d50a

Please sign in to comment.