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 <aasharma@redhat.com>
(cherry picked from commit
d0a1431fb836f1dd227df85f9e75e098edfdeac9)
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