diff options
Diffstat (limited to 'src/mongo/db/s/config/configsvr_enable_sharding_command.cpp')
-rw-r--r-- | src/mongo/db/s/config/configsvr_enable_sharding_command.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/db/s/config/configsvr_enable_sharding_command.cpp b/src/mongo/db/s/config/configsvr_enable_sharding_command.cpp index 198f108cc1d..64c0f462c3b 100644 --- a/src/mongo/db/s/config/configsvr_enable_sharding_command.cpp +++ b/src/mongo/db/s/config/configsvr_enable_sharding_command.cpp @@ -98,11 +98,9 @@ public: const std::string& dbname_unused, const BSONObj& cmdObj, BSONObjBuilder& result) { - - if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) { - uasserted(ErrorCodes::IllegalOperation, - "_configsvrEnableSharding can only be run on config servers"); - } + uassert(ErrorCodes::IllegalOperation, + "_configsvrEnableSharding can only be run on config servers", + serverGlobalParams.clusterRole == ClusterRole::ConfigServer); // Set the operation context read concern level to local for reads into the config database. repl::ReadConcernArgs::get(opCtx) = |