You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@htrace.apache.org by cm...@apache.org on 2015/07/30 20:19:24 UTC
incubator-htrace git commit: HTRACE-220. htraced: should be able to
set log.path to the empty string via "-Dlog.path=" on the command line
(cmccabe)
Repository: incubator-htrace
Updated Branches:
refs/heads/master 708b3e897 -> 98aecf878
HTRACE-220. htraced: should be able to set log.path to the empty string via "-Dlog.path=" on the command line (cmccabe)
Project: http://git-wip-us.apache.org/repos/asf/incubator-htrace/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-htrace/commit/98aecf87
Tree: http://git-wip-us.apache.org/repos/asf/incubator-htrace/tree/98aecf87
Diff: http://git-wip-us.apache.org/repos/asf/incubator-htrace/diff/98aecf87
Branch: refs/heads/master
Commit: 98aecf878942d02cfa9de5a8fdc61b59c9182996
Parents: 708b3e8
Author: Colin Patrick Mccabe <cm...@cloudera.com>
Authored: Thu Jul 30 11:19:06 2015 -0700
Committer: Colin Patrick Mccabe <cm...@cloudera.com>
Committed: Thu Jul 30 11:19:06 2015 -0700
----------------------------------------------------------------------
htrace-htraced/go/src/org/apache/htrace/conf/config.go | 6 +-----
htrace-htraced/go/src/org/apache/htrace/conf/config_test.go | 5 ++++-
2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/98aecf87/htrace-htraced/go/src/org/apache/htrace/conf/config.go
----------------------------------------------------------------------
diff --git a/htrace-htraced/go/src/org/apache/htrace/conf/config.go b/htrace-htraced/go/src/org/apache/htrace/conf/config.go
index 3302f4d..b8f6c84 100644
--- a/htrace-htraced/go/src/org/apache/htrace/conf/config.go
+++ b/htrace-htraced/go/src/org/apache/htrace/conf/config.go
@@ -178,11 +178,7 @@ func (bld *Builder) Build() (*Config, error) {
str := bld.Argv[i]
key, val := parseAsConfigFlag(str)
if key != "" {
- if val == "" {
- cnf.settings[key] = "true"
- } else {
- cnf.settings[key] = val
- }
+ cnf.settings[key] = val
bld.Argv = append(bld.Argv[:i], bld.Argv[i+1:]...)
} else {
i++
http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/98aecf87/htrace-htraced/go/src/org/apache/htrace/conf/config_test.go
----------------------------------------------------------------------
diff --git a/htrace-htraced/go/src/org/apache/htrace/conf/config_test.go b/htrace-htraced/go/src/org/apache/htrace/conf/config_test.go
index d3509b0..9059dad 100644
--- a/htrace-htraced/go/src/org/apache/htrace/conf/config_test.go
+++ b/htrace-htraced/go/src/org/apache/htrace/conf/config_test.go
@@ -29,7 +29,7 @@ import (
// Test that parsing command-line arguments of the form -Dfoo=bar works.
func TestParseArgV(t *testing.T) {
t.Parallel()
- argv := []string{"-Dfoo=bar", "-Dbaz=123", "-DsillyMode"}
+ argv := []string{"-Dfoo=bar", "-Dbaz=123", "-DsillyMode", "-Dlog.path="}
bld := &Builder{Argv: argv}
cnf, err := bld.Build()
if err != nil {
@@ -47,6 +47,9 @@ func TestParseArgV(t *testing.T) {
if cnf.GetBool("otherSillyMode") {
t.Fatal()
}
+ if "" != cnf.Get("log.path") {
+ t.Fatal()
+ }
}
// Test that default values work.