cephfs admin: use strconv to parse env var content

The environment variable to turn on tracing will now be parsed using
strconv.ParseBool rather than just a quick-n-dirty str compare.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-08-06 14:18:15 -04:00 committed by John Mulligan
parent d327bf4f3e
commit 7d18596d9d

View File

@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"os"
"strconv"
"testing"
"time"
@ -22,7 +23,7 @@ var (
func init() {
dt := os.Getenv("GO_CEPH_TEST_DEBUG_TRACE")
if dt == "yes" || dt == "true" {
if ok, err := strconv.ParseBool(dt); ok && err == nil {
debugTrace = true
}
}