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: v16.2.8~6^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e7a739fbed4e491ccfd1d2f1dfb92c1ac8f10e15;p=ceph.git monitoring/grafana: use Path class instead of split Signed-off-by: Pere Diaz Bou --- 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')