mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
cputest: Avoid calling json_reformat in cpu-parse.sh
Various version of json_reformat use different number of spaces for indenting. Let's use a simple python reformatter to gain full control over the formatting for consistent results. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
0d88c25f2c
commit
9d62af7283
@ -42,7 +42,7 @@ json()
|
||||
while read; do
|
||||
$first || echo
|
||||
first=false
|
||||
json_reformat <<<"$REPLY" | tr -s '\n'
|
||||
$(dirname $0)/cpu-reformat.py <<<"$REPLY"
|
||||
done
|
||||
}
|
||||
|
||||
|
9
tests/cputestdata/cpu-reformat.py
Executable file
9
tests/cputestdata/cpu-reformat.py
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python2
|
||||
|
||||
import sys
|
||||
import json
|
||||
|
||||
dec = json.JSONDecoder()
|
||||
data, pos = dec.raw_decode(sys.stdin.read())
|
||||
json.dump(data, sys.stdout, indent = 2, separators = (',', ': '))
|
||||
print
|
Loading…
x
Reference in New Issue
Block a user