diff options
author | Shaun Verch <shaun.verch@mongodb.com> | 2014-05-07 18:01:04 -0400 |
---|---|---|
committer | Shaun Verch <shaun.verch@mongodb.com> | 2014-05-13 17:08:50 -0400 |
commit | a503b4b57e57f81bebddd07ed75cf116f23de350 (patch) | |
tree | ae0db9e6b4474142a3862ddf550554f1af09ba39 /src/mongo/s/mongos_options.cpp | |
parent | b3e8e45ea6f346f804161e1fe4043ba3e5850ba8 (diff) | |
download | mongo-a503b4b57e57f81bebddd07ed75cf116f23de350.tar.gz |
SERVER-13439 Make sure values explicitly set to false in config file show up in parsed result
Diffstat (limited to 'src/mongo/s/mongos_options.cpp')
-rw-r--r-- | src/mongo/s/mongos_options.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/mongo/s/mongos_options.cpp b/src/mongo/s/mongos_options.cpp index 52aeb4def09..d30b86feb5a 100644 --- a/src/mongo/s/mongos_options.cpp +++ b/src/mongo/s/mongos_options.cpp @@ -91,9 +91,6 @@ namespace mongo { sharding_options.addOptionChaining("sharding.chunkSize", "chunkSize", moe::Int, "maximum amount of data per chunk"); - sharding_options.addOptionChaining("net.ipv6", "ipv6", moe::Switch, - "enable IPv6 support (disabled by default)"); - sharding_options.addOptionChaining("net.http.JSONPEnabled", "jsonp", moe::Switch, "allow JSONP access via http (has security implications)") .setSources(moe::SourceAllLegacy); @@ -134,15 +131,18 @@ namespace mongo { bool handlePreValidationMongosOptions(const moe::Environment& params, const std::vector<std::string>& args) { - if (params.count("help")) { + if (params.count("help") && + params["help"].as<bool>() == true) { printMongosHelp(moe::startupOptions); return false; } - if (params.count("version")) { + if (params.count("version") && + params["version"].as<bool>() == true) { printShardingVersionInfo(true); return false; } - if ( params.count( "test" ) ) { + if (params.count("test") && + params["test"].as<bool>() == true) { ::mongo::logger::globalLogDomain()->setMinimumLoggedSeverity( ::mongo::logger::LogSeverity::Debug(5)); StartupTest::runTests(); @@ -179,7 +179,8 @@ namespace mongo { // "sharding.autoSplit" comes from the config file, so override it if "noAutoSplit" is set // since that comes from the command line. if (params->count("noAutoSplit")) { - Status ret = params->set("sharding.autoSplit", moe::Value(false)); + Status ret = params->set("sharding.autoSplit", + moe::Value(!(*params)["noAutoSplit"].as<bool>())); if (!ret.isOK()) { return ret; } @@ -226,12 +227,8 @@ namespace mongo { params["replication.localPingThresholdMs"].as<int>(); } - if ( params.count( "net.ipv6" ) ) { - enableIPv6(); - } - if (params.count("net.http.JSONPEnabled")) { - serverGlobalParams.jsonp = true; + serverGlobalParams.jsonp = params["net.http.JSONPEnabled"].as<bool>(); } if (params.count("noscripting")) { @@ -260,7 +257,9 @@ namespace mongo { << "and is not recommended for production" << endl; } - mongosGlobalParams.upgrade = params.count("upgrade"); + if (params.count("upgrade")) { + mongosGlobalParams.upgrade = params["upgrade"].as<bool>(); + } return Status::OK(); } |