From 255ce6ebad1d1c7c04dc5bf37a7441d9d3bb74d3 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 30 Apr 2020 12:33:50 -0700 Subject: [PATCH] openqa/server: use jq for JSON comparison as json_diff died Swiped from https://stackoverflow.com/questions/31930041/ Signed-off-by: Adam Williamson --- roles/openqa/server/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/openqa/server/tasks/main.yml b/roles/openqa/server/tasks/main.yml index 89e6f2e1dc..b5304d6c3d 100644 --- a/roles/openqa/server/tasks/main.yml +++ b/roles/openqa/server/tasks/main.yml @@ -145,7 +145,7 @@ - name: Install various other required packages package: - name: ['python3-libselinux', 'git', 'json_diff', 'libselinux-utils', 'python3-libsemanage', + name: ['python3-libselinux', 'git', 'jq', 'libselinux-utils', 'python3-libsemanage', 'nfs-utils', 'perl(Class::DBI::Pg)', 'expect', 'libguestfs-tools-c', 'libguestfs-xfs', 'libvirt-daemon-config-network', 'libvirt-python3', 'python3-libguestfs', 'virt-install', 'withlock', 'genisoimage'] @@ -360,7 +360,7 @@ changed_when: "1 != 1" - name: Check if the tests changed in previous step - shell: "/usr/share/openqa/script/dump_templates --json > /tmp/tmpl-new.json && json_diff /tmp/tmpl-old.json /tmp/tmpl-new.json" + shell: "/usr/share/openqa/script/dump_templates --json > /tmp/tmpl-new.json && diff <(jq -S . /tmp/tmpl-old.json) <(jq -S . /tmp/tmpl-new.json)" when: "(gittests is defined) and (gittests is changed)" register: testsdiff changed_when: "testsdiff.rc > 0"