simplify quotes
This commit is contained in:
parent
31eea082ab
commit
e44d8b32ae
1 changed files with 2 additions and 2 deletions
|
@ -20,9 +20,9 @@ def json_to_prom(json, prefix, instance):
|
|||
if len(v) != 1:
|
||||
prefix = prefix + "_" + v.index(item)
|
||||
if type(item) is bool:
|
||||
outlines += "{}_{}{{instance=\"{}\"}} {}\n".format(prefix, k, instance, 1 if item else 0)
|
||||
outlines += '{}_{}{{instance="{}"}} {}\n'.format(prefix, k, instance, 1 if item else 0)
|
||||
if type(item) in [int, str]:
|
||||
outlines += "{}_{}{{instance=\"{}\"}} {}\n".format(prefix, k, instance,item)
|
||||
outlines += '{}_{}{{instance="{}"}} {}\n'.format(prefix, k, instance,item)
|
||||
if type(item) is dict:
|
||||
outlines += json_to_prom(item, "{}_{}".format(prefix, k), instance)
|
||||
return outlines
|
||||
|
|
Loading…
Reference in a new issue