diff options
author | Andrew Witten <andrew.witten@mongodb.com> | 2021-11-09 14:12:10 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-11-09 14:35:54 +0000 |
commit | b57e8dad9b3207bd2db8dd81cbf3a1ec8a168150 (patch) | |
tree | 22b1021650397780b8c21132e54b3a89fbe2ecbd | |
parent | af19631658dbe05e398e8fb2a79ee572e4b21759 (diff) | |
download | mongo-b57e8dad9b3207bd2db8dd81cbf3a1ec8a168150.tar.gz |
SERVER-61073 fix getParameter on healthMonitoring
-rw-r--r-- | jstests/sharding/health_monitor/set_parameter_health_monitor_intensity.js | 8 | ||||
-rw-r--r-- | src/mongo/db/process_health/health_monitoring_server_parameters.cpp | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/jstests/sharding/health_monitor/set_parameter_health_monitor_intensity.js b/jstests/sharding/health_monitor/set_parameter_health_monitor_intensity.js index a751d9b2ed8..1be31334729 100644 --- a/jstests/sharding/health_monitor/set_parameter_health_monitor_intensity.js +++ b/jstests/sharding/health_monitor/set_parameter_health_monitor_intensity.js @@ -14,8 +14,8 @@ var st = new ShardingTest({ var result = st.s0.adminCommand({"getParameter": 1, "healthMonitoring": 1}); print(tojson(result)); -assert.eq(result.dns, "off"); -assert.eq(result.ldap, "critical"); +assert.eq(result.healthMonitoring.dns, "off"); +assert.eq(result.healthMonitoring.ldap, "critical"); assert.commandFailed(st.s0.adminCommand({"setParameter": 1, healthMonitoring: {dns: "INVALID"}})); assert.commandFailed(st.s0.adminCommand({"setParameter": 1, healthMonitoring: {invalid: "off"}})); @@ -24,6 +24,6 @@ assert.commandWorked( st.s0.adminCommand({"setParameter": 1, healthMonitoring: {dns: 'non-critical', ldap: 'off'}})); var result = assert.commandWorked(st.adminCommand({"getParameter": 1, healthMonitoring: 1})); print(tojson(result)); -assert.eq(result.dns, "non-critical"); -assert.eq(result.ldap, "off"); +assert.eq(result.healthMonitoring.dns, "non-critical"); +assert.eq(result.healthMonitoring.ldap, "off"); }()); diff --git a/src/mongo/db/process_health/health_monitoring_server_parameters.cpp b/src/mongo/db/process_health/health_monitoring_server_parameters.cpp index 66d0e5fd204..f4aefdf940b 100644 --- a/src/mongo/db/process_health/health_monitoring_server_parameters.cpp +++ b/src/mongo/db/process_health/health_monitoring_server_parameters.cpp @@ -49,7 +49,9 @@ Status HealthMonitoringIntensitiesServerParameter::set(const BSONElement& newVal void HealthMonitoringIntensitiesServerParameter::append(OperationContext*, BSONObjBuilder& b, const std::string& name) { - _data->serialize(&b); + BSONObjBuilder healthMonitoring; + _data->serialize(&healthMonitoring); + b.append(name, healthMonitoring.obj()); } } // namespace mongo |