From 2db16252ff7f6d8e00149bc63b2023c84310810d Mon Sep 17 00:00:00 2001 From: Gibheer Date: Tue, 2 Oct 2018 08:58:13 +0200 Subject: [PATCH] move defaults of carbon options 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 | 6 ------ pdns/common_startup.cc | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/pdns/auth-carbon.cc b/pdns/auth-carbon.cc index dd9ffaf34b..9c3697aef6 100644 --- a/pdns/auth-carbon.cc +++ b/pdns/auth-carbon.cc @@ -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 carbonServers; stringtok(carbonServers, arg()["carbon-server"], ", "); diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 0f7dab59cc..c67ddd75ec 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -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"; -- 2.47.3