mirror of https://github.com/ceph/go-ceph
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:
parent
d327bf4f3e
commit
7d18596d9d
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue