This repository was archived by the owner on May 17, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-21
lines changed Expand file tree Collapse file tree 1 file changed +9
-21
lines changed Original file line number Diff line number Diff line change @@ -59,17 +59,11 @@ function parseBuildInfo(resp) {
5959 debug : resp . debug ,
6060 for_bits : resp . bits ,
6161 max_bson_object_size : resp . maxBsonObjectSize ,
62- enterprise_module : false ,
62+ enterprise_module : getMongoDBBuildInfo . isEnterprise ( resp ) , // Cover both cases of detecting enterprise module, see SERVER-18099.
6363 query_engine : resp . queryEngine ? resp . queryEngine : null ,
6464 raw : resp // Save the raw output to later determine if genuine MongoDB
6565 } ;
66- // cover both cases of detecting enterprise module, see SERVER-18099
67- if ( resp . gitVersion && resp . gitVersion . match ( / e n t e r p r i s e / ) ) {
68- res . enterprise_module = true ;
69- }
70- if ( resp . modules && resp . modules . indexOf ( 'enterprise' ) !== - 1 ) {
71- res . enterprise_module = true ;
72- }
66+
7367 return res ;
7468}
7569
@@ -121,22 +115,16 @@ function getGenuineMongoDB(results, done) {
121115 cmdLineOpts
122116 ) ;
123117
118+ const {
119+ isGenuine,
120+ serverName
121+ } = getMongoDBBuildInfo . getGenuineMongoDB ( buildInfo , cmdLineOpts ) ;
122+
124123 const res = {
125- isGenuine : true ,
126- dbType : 'mongodb'
124+ isGenuine,
125+ dbType : serverName
127126 } ;
128127
129- if ( buildInfo . hasOwnProperty ( '_t' ) ) {
130- res . isGenuine = false ;
131- res . dbType = 'cosmosdb' ;
132- }
133- if (
134- cmdLineOpts . hasOwnProperty ( 'errmsg' ) &&
135- cmdLineOpts . errmsg . indexOf ( 'not supported' ) !== - 1
136- ) {
137- res . isGenuine = false ;
138- res . dbType = 'documentdb' ;
139- }
140128 done ( null , res ) ;
141129}
142130
You can’t perform that action at this time.
0 commit comments