summaryrefslogtreecommitdiff
path: root/src/mongo/scripting
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-05-20 17:07:22 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-05-22 11:01:24 -0400
commiteadabb492ee5e8ad8a37bb3aedd7d198c772da62 (patch)
tree1d60f246e23ba9e886d402773a7146eeafa0aebd /src/mongo/scripting
parent8d7ea5bdb7385e6d08280aeafbc27e955ec69e0a (diff)
downloadmongo-eadabb492ee5e8ad8a37bb3aedd7d198c772da62.tar.gz
SERVER-18567 Replace usages of the legacy ConnectionString::parse
This is all the non-sharding code, which is using it.
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r--src/mongo/scripting/v8-3.25_db.cpp10
-rw-r--r--src/mongo/scripting/v8_db.cpp10
2 files changed, 12 insertions, 8 deletions
diff --git a/src/mongo/scripting/v8-3.25_db.cpp b/src/mongo/scripting/v8-3.25_db.cpp
index 0c9054314bd..69066dfb2f3 100644
--- a/src/mongo/scripting/v8-3.25_db.cpp
+++ b/src/mongo/scripting/v8-3.25_db.cpp
@@ -139,12 +139,14 @@ namespace mongo {
args.IsConstructCall());
verify(scope->MongoFT()->HasInstance(args.This()));
- string errmsg;
- ConnectionString cs = ConnectionString::parse(host, errmsg);
- if (!cs.isValid()) {
- return v8AssertionException(errmsg);
+ auto statusWithHost = ConnectionString::parse(host);
+ if (!status.isOK()) {
+ return v8AssertionException(statusWithHost.getStatus().reason());
}
+ const ConnectionString cs(statusWithHost.getValue());
+
+ string errmsg;
DBClientBase* conn;
conn = cs.connect(errmsg);
if (!conn) {
diff --git a/src/mongo/scripting/v8_db.cpp b/src/mongo/scripting/v8_db.cpp
index c4b45d29ad9..2f9ae8c604e 100644
--- a/src/mongo/scripting/v8_db.cpp
+++ b/src/mongo/scripting/v8_db.cpp
@@ -145,12 +145,14 @@ namespace mongo {
args.IsConstructCall());
verify(scope->MongoFT()->HasInstance(args.This()));
- string errmsg;
- ConnectionString cs = ConnectionString::parse(host, errmsg);
- if (!cs.isValid()) {
- return v8AssertionException(errmsg);
+ auto statusWithHost = ConnectionString::parse(host);
+ if (!statusWithHost.isOK()) {
+ return v8AssertionException(statusWithHost.getStatus().reason());
}
+ const ConnectionString cs(statusWithHost.getValue());
+
+ string errmsg;
DBClientBase* conn;
conn = cs.connect(errmsg);
if (!conn) {