]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
move defaults of carbon options 6959/head
authorGibheer <gibheer+git@zero-knowledge.org>
Tue, 2 Oct 2018 06:58:13 +0000 (08:58 +0200)
committerGibheer <gibheer+git@zero-knowledge.org>
Tue, 2 Oct 2018 06:58:13 +0000 (08:58 +0200)
There is not need to set the defaults in at the point of usage when it
can be set directly when reading the config value.

pdns/auth-carbon.cc
pdns/common_startup.cc

index dd9ffaf34bf8c16a97fa133ab400ef8f4002bc36..9c3697aef6f213d9c1ec421127615c6db94882e4 100644 (file)
@@ -37,9 +37,6 @@ try
   extern StatBag S;
 
   string namespace_name=arg()["carbon-namespace"];
-  if(namespace_name.empty()) {
-    namespace_name="pdns";
-  }
   string hostname=arg()["carbon-ourname"];
   if(hostname.empty()) {
     char tmp[80];
@@ -51,9 +48,6 @@ try
     boost::replace_all(hostname, ".", "_");
   }
   string instance_name=arg()["carbon-instancename"];
-  if(instance_name.empty()) {
-    instance_name="auth";
-  }
 
   vector<string> carbonServers;
   stringtok(carbonServers, arg()["carbon-server"], ", ");
index 0f7dab59ccf2d30951fbb98e02e4f1a50a20e071..c67ddd75ecff6b09e0598e38e5e6df621630c4d6 100644 (file)
@@ -154,9 +154,9 @@ void declareArguments()
   ::arg().setSwitch("do-ipv6-additional-processing", "Do AAAA additional processing")="yes";
   ::arg().setSwitch("query-logging","Hint backends that queries should be logged")="no";
 
-  ::arg().set("carbon-namespace", "If set overwrites the first part of the carbon string)=");
+  ::arg().set("carbon-namespace", "If set overwrites the first part of the carbon string")="pdns";
   ::arg().set("carbon-ourname", "If set, overrides our reported hostname for carbon stats")="";
-  ::arg().set("carbon-instancename", "If set overwrites the the instance name default)=");
+  ::arg().set("carbon-instancename", "If set overwrites the the instance name default")="auth";
   ::arg().set("carbon-server", "If set, send metrics in carbon (graphite) format to this server IP address")="";
   ::arg().set("carbon-interval", "Number of seconds between carbon (graphite) updates")="30";