cpu-parse: Move call to cpu-cpuid.py to new script

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2020-12-15 17:25:08 +01:00 committed by Michal Privoznik
parent 56d496d926
commit 0b683f805f
2 changed files with 10 additions and 10 deletions

View File

@ -282,6 +282,16 @@ def parse(args):
output_xml(data, filename_xml)
output_json(data, filename_json)
if not os.path.isfile(filename_json):
return
if os.path.getsize(filename_json) == 0:
return
output = subprocess.check_output(
["./cpu-cpuid.py", "diff", filename_json],
universal_newlines=True)
print(output)
os.environ["CPU_GATHER_PY"] = "true"
os.environ["model"] = data["name"]
os.environ["fname"] = filename

View File

@ -6,13 +6,3 @@ if [ -z "${CPU_GATHER_PY}" ]; then
fi
data=`cat`
if [[ -s $fname.json ]]; then
if ! grep -q model-expansion $fname.json; then
echo "Missing query-cpu-model-expansion reply in $name.json" >&2
exit 1
fi
$(dirname $0)/cpu-cpuid.py diff $fname.json
else
rm $fname.json
fi