From 20ae77fa2fca09470e9fea0f0cfd4b3e1b968237 Mon Sep 17 00:00:00 2001 From: Aashish Sharma Date: Mon, 8 May 2023 12:49:13 +0530 Subject: [PATCH] mgr/dashboard: fix regression caused by cephPgImabalance alert because of an earlier fix delivered, there is a regression caused by it due to which alerts are not getting displayed in the active alerts tab. This PR intends to fix this issue. Fixes: https://tracker.ceph.com/issues/59666 Signed-off-by: Aashish Sharma (cherry picked from commit d0a1431fb836f1dd227df85f9e75e098edfdeac9) --- src/pybind/mgr/dashboard/controllers/prometheus.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/pybind/mgr/dashboard/controllers/prometheus.py b/src/pybind/mgr/dashboard/controllers/prometheus.py index d49f3436333fc..7989a29563b19 100644 --- a/src/pybind/mgr/dashboard/controllers/prometheus.py +++ b/src/pybind/mgr/dashboard/controllers/prometheus.py @@ -66,11 +66,7 @@ class PrometheusRESTController(RESTController): alerts_info = [] if 'data' in content: if balancer_status['active'] and balancer_status['no_optimization_needed'] and path == '/alerts': # noqa E501 #pylint: disable=line-too-long - for alert in content['data']: - for k, v in alert.items(): - if k == 'labels': - alerts_info.append(v) - alerts_info = [i for i in alerts_info if i['alertname'] != 'CephPGImbalance'] + alerts_info = [alert for alert in content['data'] if alert['labels']['alertname'] != 'CephPGImbalance'] # noqa E501 #pylint: disable=line-too-long return alerts_info return content['data'] return content -- 2.39.5