Skip to content

Commit

Permalink
Remove duplicated Output
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenz Kästle committed Dec 3, 2024
1 parent 0d78bf9 commit 9540846
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmd/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ func queryDatastores() {

// Calculate results and add perf data to list.
perfData, state := processQueryResults(datastoreName, capacity, freeSpace)
pl.Add(&perfData)

// Create PartialResult and add to Overall result.
pr := result.PartialResult{
Expand All @@ -141,15 +140,14 @@ func queryDatastores() {
if err = pr.SetState(state); err != nil {
check.ExitError(err)
}
pr.Perfdata.Add(&perfData)

aggregatedResult.AddSubcheck(pr)
}

dbConnection.Close()

fmt.Printf("%s | %s\n\n", aggregatedResult.GetOutput(), pl.String())

check.ExitRaw(aggregatedResult.GetStatus(), aggregatedResult.GetOutput()+" | "+pl.String()) // ExitRaw because of 'nested formatting issues' otherwise.
check.ExitRaw(aggregatedResult.GetStatus(), aggregatedResult.GetOutput()) // ExitRaw because of 'nested formatting issues' otherwise.
}

// Computes Perfdata, check result based on the queried data.
Expand Down

0 comments on commit 9540846

Please sign in to comment.