From e7a739fbed4e491ccfd1d2f1dfb92c1ac8f10e15 Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou Date: Mon, 3 Jan 2022 12:52:09 +0100 Subject: [PATCH] monitoring/grafana: use Path class instead of split Signed-off-by: Pere Diaz Bou --- monitoring/ceph-mixin/tests_dashboards/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitoring/ceph-mixin/tests_dashboards/util.py b/monitoring/ceph-mixin/tests_dashboards/util.py index ce1456c72573..4310eb207f05 100644 --- a/monitoring/ceph-mixin/tests_dashboards/util.py +++ b/monitoring/ceph-mixin/tests_dashboards/util.py @@ -57,8 +57,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') -- 2.47.3