From: Pere Diaz Bou Date: Mon, 3 Jan 2022 11:52:09 +0000 (+0100) Subject: monitoring/grafana: use Path class instead of split X-Git-Tag: v18.0.0~1545^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a3cf5c5e9fad32753e5263994eaa2754157af92f;p=ceph-ci.git monitoring/grafana: use Path class instead of split Signed-off-by: Pere Diaz Bou --- diff --git a/monitoring/grafana/dashboards/tests/util.py b/monitoring/grafana/dashboards/tests/util.py index 526f7a73752..8bc097875d7 100644 --- a/monitoring/grafana/dashboards/tests/util.py +++ b/monitoring/grafana/dashboards/tests/util.py @@ -56,8 +56,8 @@ def add_dashboard_queries(data: Dict[str, Any], dashboard_data: Dict[str, Any], # NOTE: If two or more panels have the same name and legend it # might suggest a refactoring is needed or add something else # to identify each query. - conflict_file = data['queries'][query_id]['path'].split('/')[-1] - file = path.split('/')[-1] + conflict_file = Path(data['queries'][query_id]['path']).name + file = Path(path).name cprint((f'ERROR: Query in panel "{title}" with legend "{legend_format}"' f' already exists. Conflict "{conflict_file}" ' f'with: "{file}"'), 'red')