]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu-parse: Move call to cpu-cpuid.py to new script
authorTim Wiederhake <twiederh@redhat.com>
Tue, 15 Dec 2020 16:25:08 +0000 (17:25 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 18 Dec 2020 22:20:41 +0000 (23:20 +0100)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/cputestdata/cpu-gather.py
tests/cputestdata/cpu-parse.sh

index 2c3f39ab35d88a780c3c672f68a233b682be5f33..373f179c8d1ea732b30d79148332d1fdfe85b7bb 100755 (executable)
@@ -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
index aeb6e4e07fe831b924724a1e0dfdb70422c64044..eea15ded2ef062137c520b03611ca42d2efd0c99 100755 (executable)
@@ -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