]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: osd-scrub-repair.sh handle older versions of jq
authorDavid Zafman <dzafman@redhat.com>
Wed, 2 Aug 2017 20:26:19 +0000 (13:26 -0700)
committerDavid Zafman <dzafman@redhat.com>
Thu, 10 Aug 2017 15:30:47 +0000 (08:30 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
qa/standalone/scrub/osd-scrub-repair.sh

index 6f36149e10dffc75fad0ce05558e999862838f90..64f50b3da0274f8e55496e02875405427a01e083 100755 (executable)
@@ -30,7 +30,11 @@ fi
 getjson="no"
 
 # Ignore the epoch and filter out the attr '_' value because it has date information and won't match
-jqfilter='.inconsistents | (.[].shards[].attrs[]? | select(.name == "_") | .value) |= "----Stripped-by-test----"'
+if [ "$(jq --version 2>&1 | awk '{ print $3}')" = "1.3" ]; then # Not sure all versions that apply here
+    jqfilter='.inconsistents | (.[].shards[].attrs[] | select(.name == "_") | .value) |= "----Stripped-by-test----"'
+else
+    jqfilter='.inconsistents | (.[].shards[].attrs[]? | select(.name == "_") | .value) |= "----Stripped-by-test----"'
+fi
 sortkeys='import json; import sys ; JSON=sys.stdin.read() ; ud = json.loads(JSON) ; print json.dumps(ud, sort_keys=True, indent=2)'
 
 # Remove items are not consistent across runs, the pg interval and client