summaryrefslogtreecommitdiff
path: root/src/mongo/shell
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2020-04-26 07:05:39 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-12-08 22:45:08 +0000
commit7c51aca7fd085ead0ae3e19d967ff1abf111d13a (patch)
treebecfe057d3dbbb88b02ad628fb1a95a30adf686c /src/mongo/shell
parent987484b4aa34deea1db7d70228989b83448a24e8 (diff)
downloadmongo-7c51aca7fd085ead0ae3e19d967ff1abf111d13a.tar.gz
SERVER-40811 make initializers throwy
- Consolidate init-related headers (just init.h and initializer.h) - Factor out a separate DependencyGraph component - Remove MONGO_DEFAULT_PREREQUISITES, MONGO_NO_PREREQUISITES, MONGO_NO_DEPENDENTS. - Document the role of the "default" initializer.
Diffstat (limited to 'src/mongo/shell')
-rw-r--r--src/mongo/shell/encrypted_dbclient_base.cpp1
-rw-r--r--src/mongo/shell/kms_aws.cpp1
-rw-r--r--src/mongo/shell/kms_local.cpp1
-rw-r--r--src/mongo/shell/kms_shell.cpp1
-rw-r--r--src/mongo/shell/mongo_main.cpp2
-rw-r--r--src/mongo/shell/mongodbcr.cpp1
-rw-r--r--src/mongo/shell/shell_options_init.cpp8
7 files changed, 1 insertions, 14 deletions
diff --git a/src/mongo/shell/encrypted_dbclient_base.cpp b/src/mongo/shell/encrypted_dbclient_base.cpp
index 688484c4769..dd20a63e9cf 100644
--- a/src/mongo/shell/encrypted_dbclient_base.cpp
+++ b/src/mongo/shell/encrypted_dbclient_base.cpp
@@ -787,7 +787,6 @@ std::unique_ptr<DBClientBase> createEncryptedDBClientBase(std::unique_ptr<DBClie
MONGO_INITIALIZER(setCallbacksForEncryptedDBClientBase)(InitializerContext*) {
mongo::mozjs::setEncryptedDBClientCallback(createEncryptedDBClientBase);
- return Status::OK();
}
} // namespace
diff --git a/src/mongo/shell/kms_aws.cpp b/src/mongo/shell/kms_aws.cpp
index 4b2364fe3d7..2cc3b2ee2bd 100644
--- a/src/mongo/shell/kms_aws.cpp
+++ b/src/mongo/shell/kms_aws.cpp
@@ -334,7 +334,6 @@ MONGO_INITIALIZER(KMSRegister)(::mongo::InitializerContext* context) {
kms_message_init();
KMSServiceController::registerFactory(KMSProviderEnum::aws,
std::make_unique<AWSKMSServiceFactory>());
- return Status::OK();
}
} // namespace mongo
diff --git a/src/mongo/shell/kms_local.cpp b/src/mongo/shell/kms_local.cpp
index 1430596c18e..10fcb46f2a8 100644
--- a/src/mongo/shell/kms_local.cpp
+++ b/src/mongo/shell/kms_local.cpp
@@ -141,7 +141,6 @@ public:
MONGO_INITIALIZER(LocalKMSRegister)(::mongo::InitializerContext* context) {
KMSServiceController::registerFactory(KMSProviderEnum::local,
std::make_unique<LocalKMSServiceFactory>());
- return Status::OK();
}
} // namespace mongo
diff --git a/src/mongo/shell/kms_shell.cpp b/src/mongo/shell/kms_shell.cpp
index f05fbdf3c8e..673fe7fb921 100644
--- a/src/mongo/shell/kms_shell.cpp
+++ b/src/mongo/shell/kms_shell.cpp
@@ -45,7 +45,6 @@ void callback_fn(Scope& scope) {
MONGO_INITIALIZER(setKeyvaultCallback)(InitializerContext*) {
shell_utils::setEnterpriseShellCallback(mongo::callback_fn);
- return Status::OK();
}
} // namespace
diff --git a/src/mongo/shell/mongo_main.cpp b/src/mongo/shell/mongo_main.cpp
index 6d0ff876265..32328dbe682 100644
--- a/src/mongo/shell/mongo_main.cpp
+++ b/src/mongo/shell/mongo_main.cpp
@@ -120,12 +120,10 @@ MONGO_INITIALIZER_WITH_PREREQUISITES(SetFeatureCompatibilityVersionLatest,
(InitializerContext* context) {
mongo::serverGlobalParams.mutableFeatureCompatibility.setVersion(
ServerGlobalParams::FeatureCompatibility::kLatest);
- return Status::OK();
}
MONGO_INITIALIZER_WITH_PREREQUISITES(WireSpec, ("EndStartupOptionSetup"))(InitializerContext*) {
WireSpec::instance().initialize(WireSpec::Specification{});
- return Status::OK();
}
const auto kAuthParam = "authSource"s;
diff --git a/src/mongo/shell/mongodbcr.cpp b/src/mongo/shell/mongodbcr.cpp
index b177a316426..e90320c527e 100644
--- a/src/mongo/shell/mongodbcr.cpp
+++ b/src/mongo/shell/mongodbcr.cpp
@@ -138,7 +138,6 @@ Future<void> authMongoCRImpl(RunCommandHook runCommand, const BSONObj& params) {
MONGO_INITIALIZER(RegisterAuthMongoCR)(InitializerContext* context) {
authMongoCR = authMongoCRImpl;
- return Status::OK();
}
} // namespace
diff --git a/src/mongo/shell/shell_options_init.cpp b/src/mongo/shell/shell_options_init.cpp
index 2ea64570bc8..b89b024a2b6 100644
--- a/src/mongo/shell/shell_options_init.cpp
+++ b/src/mongo/shell/shell_options_init.cpp
@@ -42,12 +42,7 @@ MONGO_STARTUP_OPTIONS_VALIDATE(MongoShellOptions)(InitializerContext* context) {
if (!handlePreValidationMongoShellOptions(moe::startupOptionsParsed, context->args())) {
quickExit(EXIT_SUCCESS);
}
- Status ret = moe::startupOptionsParsed.validate();
- if (!ret.isOK()) {
- return ret;
- }
-
- return Status::OK();
+ uassertStatusOK(moe::startupOptionsParsed.validate());
}
MONGO_STARTUP_OPTIONS_STORE(MongoShellOptions)(InitializerContext* context) {
@@ -57,6 +52,5 @@ MONGO_STARTUP_OPTIONS_STORE(MongoShellOptions)(InitializerContext* context) {
std::cerr << "try '" << context->args()[0] << " --help' for more information" << std::endl;
quickExit(EXIT_BADOPTIONS);
}
- return Status::OK();
}
} // namespace mongo