diff --git a/core/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/action/node/ScheduledJobStats.kt b/core/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/action/node/ScheduledJobStats.kt index cf7d010f..1a0a3e67 100644 --- a/core/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/action/node/ScheduledJobStats.kt +++ b/core/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/action/node/ScheduledJobStats.kt @@ -43,7 +43,6 @@ class ScheduledJobStats : BaseNodeResponse, ToXContentFragment { lateinit var status: ScheduleStatus var jobSweeperMetrics: JobSweeperMetrics? = null var jobInfos: Array? = null - val nodeRoles = node.roles.map { it.roleName().toUpperCase() } constructor() @@ -84,7 +83,7 @@ class ScheduledJobStats : BaseNodeResponse, ToXContentFragment { override fun toXContent(builder: XContentBuilder, params: ToXContent.Params): XContentBuilder { builder.field("name", node.name) builder.field("schedule_status", status) - builder.field("roles", nodeRoles) + builder.field("roles", node.roles.map { it.roleName().toUpperCase() }) if (jobSweeperMetrics != null) { builder.startObject(RestScheduledJobStatsHandler.JOB_SCHEDULING_METRICS) jobSweeperMetrics!!.toXContent(builder, params)