Skip to content

Commit

Permalink
Update convert-dash-from-PMM.py (#1301)
Browse files Browse the repository at this point in the history
Expressions can be dictionaries or strings

Co-authored-by: Roma Novikov <[email protected]>
Co-authored-by: Anton Bystrov <[email protected]>
Co-authored-by: Shashank Sinha <[email protected]>
  • Loading branch information
4 people authored Apr 23, 2022
1 parent 928d157 commit 68eafa5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion misc/convert-dash-from-PMM.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@



#!/usr/bin/env python
#!/usr/bin/env python2

import sys
import json
Expand Down Expand Up @@ -105,6 +105,8 @@ def check_formulas(dashboard, currentVariableName, newVariableName):
for list_index, lists in enumerate(dashboard['templating']['list']):
if 'query' in lists.keys():
expr = dashboard['templating']['list'][list_index]['query']
if isinstance(expr, dict) and ('query' in expr):
expr = expr['query']
expr = re.sub('node_type=~\"[a-z,$_|]*\"', '', expr)
name = dashboard['templating']['list'][list_index]['name']
name = re.sub('node_type=~\"[a-z,$_|]*\"', '', name)
Expand Down

0 comments on commit 68eafa5

Please sign in to comment.