diff options
-rw-r--r-- | buildscripts/idl/idl/ast.py | 2 | ||||
-rw-r--r-- | buildscripts/idl/idl/binder.py | 2 | ||||
-rw-r--r-- | buildscripts/idl/idl/generator.py | 14 | ||||
-rw-r--r-- | buildscripts/idl/idl/parser.py | 2 | ||||
-rw-r--r-- | buildscripts/idl/idl/syntax.py | 2 | ||||
-rw-r--r-- | src/mongo/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/db/SConscript | 18 | ||||
-rw-r--r-- | src/mongo/db/server_options.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/server_options.h | 1 | ||||
-rw-r--r-- | src/mongo/db/server_options_base.cpp | 90 | ||||
-rw-r--r-- | src/mongo/db/server_options_base.h | 47 | ||||
-rw-r--r-- | src/mongo/db/server_options_base.idl | 157 | ||||
-rw-r--r-- | src/mongo/db/server_options_helpers.cpp | 154 | ||||
-rw-r--r-- | src/mongo/db/server_options_helpers.h | 7 | ||||
-rw-r--r-- | src/mongo/db/server_options_server_helpers.cpp | 3 | ||||
-rw-r--r-- | src/mongo/embedded/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/embedded/embedded_options.cpp | 11 |
17 files changed, 337 insertions, 179 deletions
diff --git a/buildscripts/idl/idl/ast.py b/buildscripts/idl/idl/ast.py index 529a762654d..628056533ea 100644 --- a/buildscripts/idl/idl/ast.py +++ b/buildscripts/idl/idl/ast.py @@ -345,7 +345,7 @@ class ConfigOption(common.SourceLocation): self.deprecated_name = [] # type: List[unicode] self.deprecated_short_name = [] # type: List[unicode] - self.description = None # type: unicode + self.description = None # type: Expression self.section = None # type: unicode self.arg_vartype = None # type: unicode self.cpp_vartype = None # type: unicode diff --git a/buildscripts/idl/idl/binder.py b/buildscripts/idl/idl/binder.py index 021e7279218..0227e31ec76 100644 --- a/buildscripts/idl/idl/binder.py +++ b/buildscripts/idl/idl/binder.py @@ -1075,7 +1075,7 @@ def _bind_config_option(ctxt, globals_spec, option): node.short_name = node.short_name + ',' + option.single_name - node.description = option.description + node.description = _bind_expression(option.description) node.arg_vartype = option.arg_vartype node.cpp_vartype = option.cpp_vartype node.cpp_varname = option.cpp_varname diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py index 44769d7ee51..c3fefabd00d 100644 --- a/buildscripts/idl/idl/generator.py +++ b/buildscripts/idl/idl/generator.py @@ -2026,12 +2026,16 @@ class _CppSourceFileWriter(_CppFileWriterBase): with self._condition(opt.condition): with self._block(section, ';'): self._writer.write_line( - common.template_args( + common.template_format( '.addOptionChaining(${name}, ${short}, moe::${argtype}, ${desc}, ${deprname}, ${deprshortname})', - name=_encaps(opt.name), short=_encaps( - opt.short_name), argtype=opt.arg_vartype, desc=_encaps(opt.description), - deprname=_encaps_list(opt.deprecated_name), deprshortname=_encaps_list( - opt.deprecated_short_name))) + { + 'name': _encaps(opt.name), + 'short': _encaps(opt.short_name), + 'argtype': opt.arg_vartype, + 'desc': _get_expression(opt.description), + 'deprname': _encaps_list(opt.deprecated_name), + 'deprshortname': _encaps_list(opt.deprecated_short_name), + })) self._writer.write_line('.setSources(moe::%s)' % (opt.source)) if opt.hidden: self._writer.write_line('.hidden()') diff --git a/buildscripts/idl/idl/parser.py b/buildscripts/idl/idl/parser.py index 143d8b59be4..826fc2da3ee 100644 --- a/buildscripts/idl/idl/parser.py +++ b/buildscripts/idl/idl/parser.py @@ -624,7 +624,7 @@ def _parse_config_option(ctxt, spec, name, node): "single_name": _RuleDesc('scalar'), "deprecated_name": _RuleDesc('scalar_or_sequence'), "deprecated_short_name": _RuleDesc('scalar_or_sequence'), - "description": _RuleDesc('scalar', _RuleDesc.REQUIRED), + "description": _RuleDesc('scalar_or_mapping', _RuleDesc.REQUIRED, _parse_expression), "section": _RuleDesc('scalar'), "arg_vartype": _RuleDesc('scalar', _RuleDesc.REQUIRED), "cpp_vartype": _RuleDesc('scalar'), diff --git a/buildscripts/idl/idl/syntax.py b/buildscripts/idl/idl/syntax.py index 1eb614e1e8a..3e9c0a9fa09 100644 --- a/buildscripts/idl/idl/syntax.py +++ b/buildscripts/idl/idl/syntax.py @@ -570,7 +570,7 @@ class ConfigOption(common.SourceLocation): self.single_name = None # type: unicode self.deprecated_short_name = [] # type: List[unicode] - self.description = None # type: unicode + self.description = None # type: Expression self.section = None # type: unicode self.arg_vartype = None # type: unicode self.cpp_vartype = None # type: unicode diff --git a/src/mongo/SConscript b/src/mongo/SConscript index bdbf0e98d6f..2257c7a4874 100644 --- a/src/mongo/SConscript +++ b/src/mongo/SConscript @@ -496,6 +496,7 @@ mongos = env.Program( 'db/logical_time_metadata_hook', 'db/mongodandmongos', 'db/server_options', + 'db/server_options_base', 'db/startup_warnings_common', 'db/stats/counters', 'db/windows_options' if env.TargetOSIs('windows') else [], diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript index a15037350be..86402e58555 100644 --- a/src/mongo/db/SConscript +++ b/src/mongo/db/SConscript @@ -419,6 +419,21 @@ if env.TargetOSIs('windows'): ], ) +env.Library( + target='server_options_base', + source=[ + 'server_options_base.cpp', + env.Idlc('server_options_base.idl')[0], + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/base', + ], + LIBDEPS_PRIVATE=[ + '$BUILD_DIR/mongo/util/options_parser/options_parser', + 'server_options_core', + ], +) + env.Clone().InjectModule("enterprise").Library( target="server_options_servers", source=[ @@ -431,6 +446,7 @@ env.Clone().InjectModule("enterprise").Library( # networking library has separate options '$BUILD_DIR/mongo/util/net/ssl_manager', 'server_options', + 'server_options_base', ], ) @@ -502,6 +518,8 @@ env.Library( ], LIBDEPS_PRIVATE=[ 'global_settings', + 'server_options_base', + '$BUILD_DIR/mongo/util/options_parser/options_parser', ] ) diff --git a/src/mongo/db/server_options.cpp b/src/mongo/db/server_options.cpp index bc65c0d9ed0..e854a3ebb06 100644 --- a/src/mongo/db/server_options.cpp +++ b/src/mongo/db/server_options.cpp @@ -41,4 +41,8 @@ namespace mongo { */ ServerGlobalParams serverGlobalParams; +std::string ServerGlobalParams::getPortSettingHelpText() { + return str::stream() << "Specify port number - " << DefaultDBPort << " by default"; +} + } // namespace mongo diff --git a/src/mongo/db/server_options.h b/src/mongo/db/server_options.h index e9517989f82..82ebf186362 100644 --- a/src/mongo/db/server_options.h +++ b/src/mongo/db/server_options.h @@ -51,6 +51,7 @@ struct ServerGlobalParams { bool isDefaultPort() const { return port == DefaultDBPort; } + static std::string getPortSettingHelpText(); std::vector<std::string> bind_ips; // --bind_ip bool enableIPv6 = false; diff --git a/src/mongo/db/server_options_base.cpp b/src/mongo/db/server_options_base.cpp new file mode 100644 index 00000000000..9b4bf8c3b9f --- /dev/null +++ b/src/mongo/db/server_options_base.cpp @@ -0,0 +1,90 @@ + +/** + * Copyright (C) 2019-present MongoDB, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * <http://www.mongodb.com/licensing/server-side-public-license>. + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the Server Side Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + +#include "mongo/db/server_options_base.h" + +#include "mongo/base/string_data.h" +#include "mongo/db/server_options_base_gen.h" +#include "mongo/logger/log_component.h" +#include "mongo/util/options_parser/option_description.h" +#include "mongo/util/options_parser/option_section.h" +#include "mongo/util/options_parser/startup_option_init.h" +#include "mongo/util/options_parser/startup_options.h" + +namespace moe = mongo::optionenvironment; + +namespace mongo { + +// Primarily dispatches to IDL defined addBaseServerOptionDefinitions, +// then adds some complex options inexpressible in IDL. +Status addBaseServerOptions(moe::OptionSection* options) { + auto status = addBaseServerOptionDefinitions(options); + if (!status.isOK()) { + return status; + } + + moe::OptionSection general_options("General options"); + + // log component hierarchy verbosity levels + for (int i = 0; i < int(logger::LogComponent::kNumLogComponents); ++i) { + logger::LogComponent component = static_cast<logger::LogComponent::Value>(i); + if (component == logger::LogComponent::kDefault) { + continue; + } + general_options + .addOptionChaining("systemLog.component." + component.getDottedName() + ".verbosity", + "", + moe::Int, + "set component verbose level for " + component.getDottedName()) + .setSources(moe::SourceYAMLConfig); + } + + /* support for -vv -vvvv etc. */ + for (std::string s = "vv"; s.length() <= 12; s.append("v")) { + general_options.addOptionChaining(s.c_str(), s.c_str(), moe::Switch, "verbose") + .hidden() + .setSources(moe::SourceAllLegacy); + } + + return options->addSection(general_options); +} + +Status validateSystemLogDestinationSetting(const std::string& value) { + constexpr auto kSyslog = "syslog"_sd; + constexpr auto kFile = "file"_sd; + + if (!kSyslog.equalCaseInsensitive(value) && !kFile.equalCaseInsensitive(value)) { + return {ErrorCodes::BadValue, "systemLog.destination expects one of 'syslog' or 'file'"}; + } + + return Status::OK(); +} + +} // namespace mongo diff --git a/src/mongo/db/server_options_base.h b/src/mongo/db/server_options_base.h new file mode 100644 index 00000000000..750c1446939 --- /dev/null +++ b/src/mongo/db/server_options_base.h @@ -0,0 +1,47 @@ + +/** + * Copyright (C) 2019-present MongoDB, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * <http://www.mongodb.com/licensing/server-side-public-license>. + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the Server Side Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + +#include <string> + +#include "mongo/base/status.h" +#include "mongo/util/options_parser/option_section.h" + +namespace mongo { + +/** + * Base server options that are available in all applications, standalone and embedded. + * + * Included by addGeneralServerOptions, don't call both. + */ +Status addBaseServerOptions(optionenvironment::OptionSection*); + +Status validateSystemLogDestinationSetting(const std::string&); + +} // namespace mongo diff --git a/src/mongo/db/server_options_base.idl b/src/mongo/db/server_options_base.idl new file mode 100644 index 00000000000..9e8dca4075b --- /dev/null +++ b/src/mongo/db/server_options_base.idl @@ -0,0 +1,157 @@ +# Copyright (C) 2019-present MongoDB, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the Server Side Public License, version 1, +# as published by MongoDB, Inc. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# Server Side Public License for more details. +# +# You should have received a copy of the Server Side Public License +# along with this program. If not, see +# <http://www.mongodb.com/licensing/server-side-public-license>. +# +# As a special exception, the copyright holders give permission to link the +# code of portions of this program with the OpenSSL library under certain +# conditions as described in each individual source file and distribute +# linked combinations including the program with the OpenSSL library. You +# must comply with the Server Side Public License in all respects for +# all of the code used other than as permitted herein. If you modify file(s) +# with this exception, you may extend this exception to your version of the +# file(s), but you are not obligated to do so. If you do not wish to do so, +# delete this exception statement from your version. If you delete this +# exception statement from all source files in the program, then also delete +# it in the license file. +# + +global: + cpp_namespace: "mongo" + cpp_includes: + - "mongo/db/server_options.h" + - "mongo/db/server_options_base.h" + configs: + section: 'General options' + source: [ cli, ini, yaml ] + initializer: + register: addBaseServerOptionDefinitions + +configs: + # The verbosity level can be set at startup in the following ways. Note that if multiple + # methods for setting the verbosity are specified simultaneously, the verbosity will be set + # based on the whichever option specifies the highest level + # + # Command Line Option | Resulting Verbosity + # _________________________________________ + # (none) | 0 + # --verbose "" | Error after Boost 1.59 + # --verbose | 1 + # --verbose v | 1 + # --verbose vv | 2 (etc.) + # -v | 1 + # -vv | 2 (etc.) + # + # INI Config Option | Resulting Verbosity + # _________________________________________ + # verbose= | 0 + # verbose=v | 1 + # verbose=vv | 2 (etc.) + # v=true | 1 + # vv=true | 2 (etc.) + # + # YAML Config Option | Resulting Verbosity + # _________________________________________ + # systemLog: | + # verbosity: 5 | 5 + # systemLog: | + # component: | + # verbosity: 5 | 5 + # systemLog: | + # component: | + # Sharding: | + # verbosity: 5 | 5 (for Sharding only, 0 for default) + verbose: + description: 'Be more verbose (include multiple times for more verbosity e.g. -vvvvv)' + single_name: v + arg_vartype: String + source: [ cli, ini ] + implicit: v + # vv-vvvvvvvvvvvv defined in server_options_base.cpp + + 'systemLog.verbosity': + description: 'Set verbose level' + arg_vartype: Int + source: yaml + + # systemLog.component.*.verbosity defined in server_options_base.cpp + + 'systemLog.quiet': + description: 'Quieter output' + short_name: quiet + arg_vartype: Switch + 'net.port': + description: + expr: 'ServerGlobalParams::getPortSettingHelpText()' + is_constexpr: false + short_name: port + arg_vartype: Int + logpath: + # Cannot roll into systemLog.path because canonicalization also sets systemLog.destination. + description: 'Log file to send write to instead of stdout - has to be a file, not directory' + source: [ cli, ini ] + arg_vartype: String + conflicts: syslog + hidden: true + 'systemLog.path': + description: 'Log file to send write to instead of stdout - has to be a file, not directory' + source: yaml + arg_vartype: String + conflicts: syslog + 'systemLog.destination': + description: 'Destination of system log output. (syslog/file)' + arg_vartype: String + source: yaml + hidden: true + validator: + callback: validateSystemLogDestinationSetting + + syslog: + description: "Log to system's syslog facility instead of file or stdout" + arg_vartype: Switch + source: [ cli, ini ] + conflicts: 'systemLog.path' + condition: + preprocessor: '!defined(_WIN32)' + 'systemLog.syslogFacility': + description: 'syslog facility used for mongodb syslog message' + short_name: syslogFacility + arg_vartype: String + condition: + preprocessor: '!defined(_WIN32)' + + 'systemLog.logAppend': + description: 'Append to logpath instead of over-writing' + short_name: logappend + arg_vartype: Switch + 'systemLog.logRotate': + description: 'Set the log rotation behavior (rename|reopen)' + short_name: logRotate + arg_vartype: String + 'systemLog.timeStampFormat': + description: Desired format for timestamps in log messages. One of ctime, iso8601-utc or iso8601-local + short_name: timeStampFormat + arg_vartype: String + + setParameter: + description: 'Set a configurable parameter' + arg_vartype: StringMap + duplicate_behavior: append + + # -vvvvv + + 'systemLog.traceAllExceptions': + description: 'Log stack traces for every exception' + short_name: traceExceptions + arg_vartype: Switch + hidden: true diff --git a/src/mongo/db/server_options_helpers.cpp b/src/mongo/db/server_options_helpers.cpp index 8f49ba0e2bc..5b1828c4088 100644 --- a/src/mongo/db/server_options_helpers.cpp +++ b/src/mongo/db/server_options_helpers.cpp @@ -97,160 +97,6 @@ CODE facilitynames[] = {{"auth", LOG_AUTH}, {"cron", LOG_CRON}, {"daemon #endif // !defined(INTERNAL_NOPRI) #endif // defined(SYSLOG_NAMES) - -} // namespace - -Status addBaseServerOptions(moe::OptionSection* options) { - StringBuilder portInfoBuilder; - - portInfoBuilder << "specify port number - " << ServerGlobalParams::DefaultDBPort - << " by default"; - - // The verbosity level can be set at startup in the following ways. Note that if multiple - // methods for setting the verbosity are specified simultaneously, the verbosity will be set - // based on the whichever option specifies the highest level - // - // Command Line Option | Resulting Verbosity - // _________________________________________ - // (none) | 0 - // --verbose "" | Error after Boost 1.59 - // --verbose | 1 - // --verbose v | 1 - // --verbose vv | 2 (etc.) - // -v | 1 - // -vv | 2 (etc.) - // - // INI Config Option | Resulting Verbosity - // _________________________________________ - // verbose= | 0 - // verbose=v | 1 - // verbose=vv | 2 (etc.) - // v=true | 1 - // vv=true | 2 (etc.) - // - // YAML Config Option | Resulting Verbosity - // _________________________________________ - // systemLog: | - // verbosity: 5 | 5 - // systemLog: | - // component: | - // verbosity: 5 | 5 - // systemLog: | - // component: | - // Sharding: | - // verbosity: 5 | 5 (for Sharding only, 0 for default) - options - ->addOptionChaining( - "verbose", - "verbose,v", - moe::String, - "be more verbose (include multiple times for more verbosity e.g. -vvvvv)") - .setImplicit(moe::Value(std::string("v"))) - .setSources(moe::SourceAllLegacy); - - options->addOptionChaining("systemLog.verbosity", "", moe::Int, "set verbose level") - .setSources(moe::SourceYAMLConfig); - - // log component hierarchy verbosity levels - for (int i = 0; i < int(logger::LogComponent::kNumLogComponents); ++i) { - logger::LogComponent component = static_cast<logger::LogComponent::Value>(i); - if (component == logger::LogComponent::kDefault) { - continue; - } - options - ->addOptionChaining("systemLog.component." + component.getDottedName() + ".verbosity", - "", - moe::Int, - "set component verbose level for " + component.getDottedName()) - .setSources(moe::SourceYAMLConfig); - } - - options->addOptionChaining("systemLog.quiet", "quiet", moe::Switch, "quieter output"); - - options->addOptionChaining("net.port", "port", moe::Int, portInfoBuilder.str().c_str()); - - options - ->addOptionChaining( - "logpath", - "logpath", - moe::String, - "log file to send write to instead of stdout - has to be a file, not directory") - .setSources(moe::SourceAllLegacy) - .incompatibleWith("syslog"); - - options - ->addOptionChaining( - "systemLog.path", - "", - moe::String, - "log file to send writes to if logging to a file - has to be a file, not directory") - .setSources(moe::SourceYAMLConfig) - .hidden(); - - options - ->addOptionChaining("systemLog.destination", - "", - moe::String, - "Destination of system log output. (syslog/file)") - .setSources(moe::SourceYAMLConfig) - .hidden() - .format("(:?syslog)|(:?file)", "(syslog/file)"); - -#ifndef _WIN32 - options - ->addOptionChaining("syslog", - "syslog", - moe::Switch, - "log to system's syslog facility instead of file or stdout") - .incompatibleWith("logpath") - .setSources(moe::SourceAllLegacy); - - options->addOptionChaining("systemLog.syslogFacility", - "syslogFacility", - moe::String, - "syslog facility used for mongodb syslog message"); - -#endif // _WIN32 - options->addOptionChaining("systemLog.logAppend", - "logappend", - moe::Switch, - "append to logpath instead of over-writing"); - - options->addOptionChaining("systemLog.logRotate", - "logRotate", - moe::String, - "set the log rotation behavior (rename|reopen)"); - - options->addOptionChaining("systemLog.timeStampFormat", - "timeStampFormat", - moe::String, - "Desired format for timestamps in log messages. One of ctime, " - "iso8601-utc or iso8601-local"); - - options - ->addOptionChaining( - "setParameter", "setParameter", moe::StringMap, "Set a configurable parameter") - .composing(); - - /* support for -vv -vvvv etc. */ - for (string s = "vv"; s.length() <= 12; s.append("v")) { - options->addOptionChaining(s.c_str(), s.c_str(), moe::Switch, "verbose") - .hidden() - .setSources(moe::SourceAllLegacy); - } - - options - ->addOptionChaining("systemLog.traceAllExceptions", - "traceExceptions", - moe::Switch, - "log stack traces for every exception") - .hidden(); - - return Status::OK(); -} - -namespace { - Status setArgvArray(const std::vector<std::string>& argv) { BSONArrayBuilder b; std::vector<std::string> censoredArgv = argv; diff --git a/src/mongo/db/server_options_helpers.h b/src/mongo/db/server_options_helpers.h index c2dfaba578e..da7098f23c4 100644 --- a/src/mongo/db/server_options_helpers.h +++ b/src/mongo/db/server_options_helpers.h @@ -43,13 +43,6 @@ class Environment; namespace moe = mongo::optionenvironment; /** - * Base server options that are available in all applications, standalone and embedded. - * - * Included by addGeneralServerOptions, don't call both. - */ -Status addBaseServerOptions(moe::OptionSection* options); - -/** * Handle custom validation of base options that can not currently be done by using * Constraints in the Environment. See the "validate" function in the Environment class for * more details. diff --git a/src/mongo/db/server_options_server_helpers.cpp b/src/mongo/db/server_options_server_helpers.cpp index 4b836399e3a..ff9cbb9d642 100644 --- a/src/mongo/db/server_options_server_helpers.cpp +++ b/src/mongo/db/server_options_server_helpers.cpp @@ -44,6 +44,7 @@ #include "mongo/bson/util/builder.h" #include "mongo/config.h" #include "mongo/db/server_options.h" +#include "mongo/db/server_options_base.h" #include "mongo/db/server_options_helpers.h" #include "mongo/db/server_parameters.h" #include "mongo/logger/log_component.h" @@ -68,7 +69,7 @@ namespace moe = ::mongo::optionenvironment; namespace mongo { Status addGeneralServerOptions(moe::OptionSection* options) { - auto baseResult = addBaseServerOptions(options); + auto baseResult = addBaseServerOptions(&moe::startupOptions); if (!baseResult.isOK()) { return baseResult; } diff --git a/src/mongo/embedded/SConscript b/src/mongo/embedded/SConscript index bd704448dc2..664f132c121 100644 --- a/src/mongo/embedded/SConscript +++ b/src/mongo/embedded/SConscript @@ -105,6 +105,7 @@ env.Library( '$BUILD_DIR/mongo/db/s/sharding_api_d', '$BUILD_DIR/mongo/db/s/sharding_runtime_d_embedded', '$BUILD_DIR/mongo/db/server_options', + '$BUILD_DIR/mongo/db/server_options_base', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/db/service_entry_point_common', '$BUILD_DIR/mongo/db/service_liaison_mongod', diff --git a/src/mongo/embedded/embedded_options.cpp b/src/mongo/embedded/embedded_options.cpp index 3112046fa2a..8ba787b2bfd 100644 --- a/src/mongo/embedded/embedded_options.cpp +++ b/src/mongo/embedded/embedded_options.cpp @@ -31,7 +31,7 @@ #include "mongo/embedded/embedded_options.h" -#include "mongo/db/server_options.h" +#include "mongo/db/server_options_base.h" #include "mongo/db/server_options_helpers.h" #include "mongo/db/storage/storage_options.h" @@ -44,9 +44,7 @@ namespace embedded { using std::string; Status addOptions(optionenvironment::OptionSection* options) { - moe::OptionSection general_options("General options"); - - Status ret = addBaseServerOptions(&general_options); + Status ret = addBaseServerOptions(options); if (!ret.isOK()) { return ret; } @@ -78,10 +76,7 @@ Status addOptions(optionenvironment::OptionSection* options) { #endif - options->addSection(general_options).transitional_ignore(); - options->addSection(storage_options).transitional_ignore(); - - return Status::OK(); + return options->addSection(storage_options); } Status canonicalizeOptions(optionenvironment::Environment* params) { |