Skip to content

Commit

Permalink
SERVER-7040 Fix startParallelShell to work when not being run in smok…
Browse files Browse the repository at this point in the history
…e.py
  • Loading branch information
stbrody committed Sep 14, 2012
1 parent b63a368 commit eb4fe5b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/mongo/shell/servers_misc.js
Expand Up @@ -258,11 +258,12 @@ function startParallelShell( jsCode, port ){
args.push("--port", port);
}

if (typeof(db) == "object") {
jsCode = "db = db.getSiblingDB('" + db.getName() + "');" + jsCode;
}

if (TestData) {
jsCode = "TestData = " + tojson(TestData) +
";jsTest.authenticate(db.getMongo());" +
((typeof(db) != 'undefined') ? "db = db.getSiblingDB('" + db.getName() + "');" : "") +
jsCode;
jsCode = "TestData = " + tojson(TestData) + ";" + jsCode;
}

args.push("--eval", jsCode);
Expand Down

0 comments on commit eb4fe5b

Please sign in to comment.