diff options
author | Billy Donahue <BillyDonahue@users.noreply.github.com> | 2022-07-27 18:17:24 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-27 19:38:08 +0000 |
commit | 958ad9abfc80861d3f43f44da694e83464b01e1d (patch) | |
tree | ca14e7097c1cb8ab20dfad7fa6888511f0226650 /src/mongo/shell | |
parent | f8a1ac19be6279e7ace012dafa8cfcaa028d49e1 (diff) | |
download | mongo-958ad9abfc80861d3f43f44da694e83464b01e1d.tar.gz |
SERVER-68246 rewrite calls to boost::optional get and is_initialized
Diffstat (limited to 'src/mongo/shell')
-rw-r--r-- | src/mongo/shell/encrypted_dbclient_base.cpp | 2 | ||||
-rw-r--r-- | src/mongo/shell/kms_aws.cpp | 6 | ||||
-rw-r--r-- | src/mongo/shell/kms_azure.cpp | 2 | ||||
-rw-r--r-- | src/mongo/shell/kms_gcp.cpp | 2 | ||||
-rw-r--r-- | src/mongo/shell/mongo_main.cpp | 6 |
5 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/shell/encrypted_dbclient_base.cpp b/src/mongo/shell/encrypted_dbclient_base.cpp index 3c90565d355..baf5fdbf002 100644 --- a/src/mongo/shell/encrypted_dbclient_base.cpp +++ b/src/mongo/shell/encrypted_dbclient_base.cpp @@ -818,7 +818,7 @@ std::unique_ptr<DBClientBase> createEncryptedDBClientBase(std::unique_ptr<DBClie // IDL does not perform a deep copy of BSONObjs when parsing, so we must get an // owned copy of the schemaMap. if (encryptionOptions.getSchemaMap()) { - encryptionOptions.setSchemaMap(encryptionOptions.getSchemaMap().get().getOwned()); + encryptionOptions.setSchemaMap(encryptionOptions.getSchemaMap().value().getOwned()); } // This logic tries to extract the client from the args. If the connection object is defined diff --git a/src/mongo/shell/kms_aws.cpp b/src/mongo/shell/kms_aws.cpp index f0a7850cbfa..5d81566348a 100644 --- a/src/mongo/shell/kms_aws.cpp +++ b/src/mongo/shell/kms_aws.cpp @@ -131,7 +131,7 @@ void AWSKMSService::initRequest(kms_request_t* request, StringData host, StringD if (!_config.sessionToken.value_or("").empty()) { // TODO: move this into kms-message uassertKmsRequest(kms_request_add_header_field( - request, "X-Amz-Security-Token", _config.sessionToken.get().c_str())); + request, "X-Amz-Security-Token", _config.sessionToken.value().c_str())); } } @@ -264,7 +264,7 @@ SecureVector<uint8_t> AWSKMSService::decrypt(ConstDataRange cdr, BSONObj masterK boost::optional<std::string> toString(boost::optional<StringData> str) { if (str) { - return {str.get().toString()}; + return {str.value().toString()}; } return boost::none; } @@ -279,7 +279,7 @@ std::unique_ptr<KMSService> AWSKMSService::create(const AwsKMS& config) { // the CA file. if (!config.getUrl().value_or("").empty()) { params.sslCAFile = sslGlobalParams.sslCAFile; - awsKMS->_server = parseUrl(config.getUrl().get()); + awsKMS->_server = parseUrl(config.getUrl().value()); } awsKMS->_sslManager = SSLManagerInterface::create(params, false); diff --git a/src/mongo/shell/kms_azure.cpp b/src/mongo/shell/kms_azure.cpp index 1673f966396..459e1f812ae 100644 --- a/src/mongo/shell/kms_azure.cpp +++ b/src/mongo/shell/kms_azure.cpp @@ -147,7 +147,7 @@ std::unique_ptr<KMSService> AzureKMSService::create(const AzureKMS& config) { // Leave the CA file empty so we default to system CA but for local testing allow it to // inherit the CA file. params.sslCAFile = sslGlobalParams.sslCAFile; - identityPlatformHostAndPort = parseUrl(config.getIdentityPlatformEndpoint().get()); + identityPlatformHostAndPort = parseUrl(config.getIdentityPlatformEndpoint().value()); } azureKMS->_sslManager = SSLManagerInterface::create(params, false); diff --git a/src/mongo/shell/kms_gcp.cpp b/src/mongo/shell/kms_gcp.cpp index dfe439bd85e..81ec2737f7e 100644 --- a/src/mongo/shell/kms_gcp.cpp +++ b/src/mongo/shell/kms_gcp.cpp @@ -284,7 +284,7 @@ std::unique_ptr<KMSService> GCPKMSService::create(const GcpKMS& config) { // Leave the CA file empty so we default to system CA but for local testing allow it to // inherit the CA file. params.sslCAFile = sslGlobalParams.sslCAFile; - oauthHostAndPort = parseUrl(config.getEndpoint().get()); + oauthHostAndPort = parseUrl(config.getEndpoint().value()); } gcpKMS->_sslManager = SSLManagerInterface::create(params, false); diff --git a/src/mongo/shell/mongo_main.cpp b/src/mongo/shell/mongo_main.cpp index 7b1dd9dce47..0f5f45f1941 100644 --- a/src/mongo/shell/mongo_main.cpp +++ b/src/mongo/shell/mongo_main.cpp @@ -681,7 +681,7 @@ bool mechanismRequiresPassword(const MongoURI& uri) { if (const auto authMechanisms = uri.getOption("authMechanism")) { constexpr std::array<StringData, 2> passwordlessMechanisms{auth::kMechanismGSSAPI, auth::kMechanismMongoX509}; - const std::string& authMechanism = authMechanisms.get(); + const std::string& authMechanism = authMechanisms.value(); for (const auto& mechanism : passwordlessMechanisms) { if (mechanism.toString() == authMechanism) { return false; @@ -787,14 +787,14 @@ int mongo_main(int argc, char* argv[]) { if (const auto authMechanisms = parsedURI.getOption("authMechanism")) { std::stringstream ss; ss << "DB.prototype._defaultAuthenticationMechanism = \"" - << str::escape(authMechanisms.get()) << "\";" << std::endl; + << str::escape(authMechanisms.value()) << "\";" << std::endl; mongo::shell_utils::dbConnect += ss.str(); } if (const auto gssapiServiveName = parsedURI.getOption("gssapiServiceName")) { std::stringstream ss; ss << "DB.prototype._defaultGssapiServiceName = \"" - << str::escape(gssapiServiveName.get()) << "\";" << std::endl; + << str::escape(gssapiServiveName.value()) << "\";" << std::endl; mongo::shell_utils::dbConnect += ss.str(); } |