Skip to content

Commit

Permalink
[ML] address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Feb 18, 2020
1 parent cc6f889 commit e60e183
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x-pack/legacy/plugins/ml/server/routes/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function systemRoutes({
}: RouteInitialization) {
async function getNodeCount(context: RequestHandlerContext) {
const filterPath = 'nodes.*.attributes';
const resp = await context.core.elasticsearch.adminClient.callAsInternalUser('nodes.info', {
const resp = await context.ml!.mlClient.callAsInternalUser('nodes.info', {
filterPath,
});

Expand Down Expand Up @@ -176,7 +176,7 @@ export function systemRoutes({
const body = { cluster: requiredPrivileges };
const resp = await context.ml!.mlClient.callAsCurrentUser('ml.privilegeCheck', { body });

if (requiredPrivileges.every(p => !!resp.cluster[p])) {
if (resp.has_all_requested) {
return response.ok({
body: await getNodeCount(context),
});
Expand Down

0 comments on commit e60e183

Please sign in to comment.