Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 9 additions & 21 deletions lib/instance-detail-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,11 @@ function parseBuildInfo(resp) {
debug: resp.debug,
for_bits: resp.bits,
max_bson_object_size: resp.maxBsonObjectSize,
enterprise_module: false,
enterprise_module: getMongoDBBuildInfo.isEnterprise(resp), // Cover both cases of detecting enterprise module, see SERVER-18099.
query_engine: resp.queryEngine ? resp.queryEngine : null,
raw: resp // Save the raw output to later determine if genuine MongoDB
};
// cover both cases of detecting enterprise module, see SERVER-18099
if (resp.gitVersion && resp.gitVersion.match(/enterprise/)) {
res.enterprise_module = true;
}
if (resp.modules && resp.modules.indexOf('enterprise') !== -1) {
res.enterprise_module = true;
}

return res;
}

Expand Down Expand Up @@ -121,22 +115,16 @@ function getGenuineMongoDB(results, done) {
cmdLineOpts
);

const {
isGenuine,
serverName
} = getMongoDBBuildInfo.getGenuineMongoDB(buildInfo, cmdLineOpts);

const res = {
isGenuine: true,
dbType: 'mongodb'
isGenuine,
dbType: serverName
};

if (buildInfo.hasOwnProperty('_t')) {
res.isGenuine = false;
res.dbType = 'cosmosdb';
}
if (
cmdLineOpts.hasOwnProperty('errmsg') &&
cmdLineOpts.errmsg.indexOf('not supported') !== -1
) {
res.isGenuine = false;
res.dbType = 'documentdb';
}
done(null, res);
}

Expand Down