From: David Zafman Date: Wed, 2 Aug 2017 20:26:19 +0000 (-0700) Subject: qa: osd-scrub-repair.sh handle older versions of jq X-Git-Tag: v12.2.0~31^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=614c596b095cbadd6fe0db5ec687c082c52f2386;p=ceph.git qa: osd-scrub-repair.sh handle older versions of jq Signed-off-by: David Zafman (cherry picked from commit 3988ebab43c575ab3532052d22940248b8988b46) --- diff --git a/qa/standalone/scrub/osd-scrub-repair.sh b/qa/standalone/scrub/osd-scrub-repair.sh index 6f36149e10df..64f50b3da027 100755 --- a/qa/standalone/scrub/osd-scrub-repair.sh +++ b/qa/standalone/scrub/osd-scrub-repair.sh @@ -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