]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard,grafana: remove shortcut menu 31951/head
authorErnesto Puerta <epuertat@redhat.com>
Mon, 2 Dec 2019 20:28:35 +0000 (21:28 +0100)
committerErnesto Puerta <epuertat@redhat.com>
Tue, 3 Dec 2019 09:21:35 +0000 (10:21 +0100)
Remove shortcut menu (links) and add check in grafana CI script.

Fixes: https://tracker.ceph.com/issues/43091
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
monitoring/grafana/dashboards/host-details.json
src/pybind/mgr/dashboard/ci/check_grafana_uids.py

index c4d139a68c007b5d227e231ead74ce7cb009b9eb..17ee37e5b1a9d52beaf3903818b1848ffaac826b 100644 (file)
   "graphTooltip": 0,
   "id": null,
   "iteration": 1557386759572,
-  "links": [
-    {
-      "asDropdown": true,
-      "icon": "external link",
-      "tags": [
-        "overview"
-      ],
-      "title": "Shortcuts",
-      "type": "dashboards"
-    }
-  ],
+  "links": [],
   "panels": [
     {
       "gridPos": {
   "timezone": "browser",
   "title": "Host Details",
   "uid": "rtOg0AiWz",
-  "version": 3
+  "version": 4
 }
index 134bb6e7fbd3242de754324f3192ff18eca32114..fac3b9953971551d1c392a5997ff94caedb55113 100644 (file)
@@ -85,6 +85,13 @@ def get_grafana_dashboards(base_dir):
         with open(json_file) as f:
             dashboard_config = json.load(f)
             uid = dashboard_config.get('uid')
+
+            # Grafana dashboard checks
+            title = dashboard_config['title']
+            assert len(title) > 0, \
+                "Title not found in '{}'".format(json_file)
+            assert len(dashboard_config.get('links', [])) == 0, \
+                "Links found in '{}'".format(json_file)
             if not uid:
                 continue
             if uid in dashboards:
@@ -92,9 +99,10 @@ def get_grafana_dashboards(base_dir):
                 error_msg = 'Duplicated UID {} found, already defined in {}'.\
                     format(uid, dashboards[uid]['file'])
                 exit(error_msg)
+
             dashboards[uid] = {
                 'file': json_file,
-                'title': dashboard_config['title']
+                'title': title
             }
     return dashboards