[elastic] double dump panels json
authordrebs <drebs@riseup.net>
Fri, 28 Apr 2017 07:48:34 +0000 (09:48 +0200)
committerdrebs <drebs@riseup.net>
Fri, 5 May 2017 07:17:34 +0000 (09:17 +0200)
elastic/generate-config.py

index 2d4c7bc..be8afcb 100755 (executable)
@@ -13,6 +13,7 @@ import sys
 
 URL='https://moose.leap.se:9200'
 
+
 def _get_logger():
     logger = logging.getLogger(__name__)
     ch = logging.StreamHandler()
@@ -23,6 +24,7 @@ def _get_logger():
 
 
 def _delete_jsons(directory):
+    logger.info('removing *.json from %s' % directory)
     for f in os.listdir(directory):
         if f.endswith('.json'):
             os.unlink(os.path.join(directory, f))
@@ -95,7 +97,7 @@ def generate_dashboards(tests):
             'type': 'visualization',
         })
 
-    context = {'panels_json': json.dumps(panels)}
+    context = {'panels_json': json.dumps(json.dumps(panels))}
     rendered = pystache.render(template, context)
     assert json.loads(rendered), rendered