mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
committed by
Michal Privoznik
parent
56d496d926
commit
0b683f805f
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user