default to using rsGetStatus for slaveReplInfo SERVER-3376

This commit is contained in:
Kristina
2011-07-07 15:48:06 -04:00
parent e987d4c8ad
commit 5f70df96b5
2 changed files with 11 additions and 9 deletions

View File

@@ -2440,13 +2440,14 @@ const StringData _jscode_raw_db =
"};\n"
"\n"
"var L = this.getSiblingDB(\"local\");\n"
"if( L.sources.count() != 0 ) {\n"
"L.sources.find().forEach(g);\n"
"}\n"
"else if (L.system.replset.count() != 0) {\n"
"\n"
"if (L.system.replset.count() != 0) {\n"
"var status = this.adminCommand({'replSetGetStatus' : 1});\n"
"status.members.forEach(r);\n"
"}\n"
"else if( L.sources.count() != 0 ) {\n"
"L.sources.find().forEach(g);\n"
"}\n"
"else {\n"
"print(\"local.sources is empty; is this db a --slave?\");\n"
"return;\n"