diff options
| author | Jenkins <jenkins@review.openstack.org> | 2014-10-14 19:44:51 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2014-10-14 19:44:51 +0000 |
| commit | ec5a16dcecce315b2a3f546d19589e817a526caf (patch) | |
| tree | bfeb40342cbd943f90b18a3e99caa8475ed84f6c /tools/validate-json.sh | |
| parent | 358e99668282127e2aeed0b76f5714ce043c1c4b (diff) | |
| parent | bfbf1b8c9b3a0abba86474aeb72b950142723d73 (diff) | |
| download | kolla-ec5a16dcecce315b2a3f546d19589e817a526caf.tar.gz kolla-ec5a16dcecce315b2a3f546d19589e817a526caf.zip | |
Merge "add better validation checks (part 1)"
Diffstat (limited to 'tools/validate-json.sh')
| -rwxr-xr-x | tools/validate-json.sh | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/tools/validate-json.sh b/tools/validate-json.sh index 35338e8d9..296ef781c 100755 --- a/tools/validate-json.sh +++ b/tools/validate-json.sh @@ -1,34 +1,3 @@ -#!/bin/bash -set -e -ret=0 +#!/bin/sh -# For MacOSX users the freebsd's mktemp by default behave diferently, -# installing the coreutils from brew would give you this but that would be -# renamed to gmktemp to don't conflict with the stand mktemp, so let just use -# that if available. -if type -p gmktemp &>/dev/null; then - TMPFILE=$(gmktemp) -else - TMPFILE=$(mktemp) -fi - -function clean { - rm -f ${TMPFILE} -} -trap clean EXIT - -linter=jsonlint -type -p jsonlint &>/dev/null || linter=python - -for f in $(find docker -type f -name '*.json');do - if [[ ${linter} == jsonlint ]];then - jsonlint -s ${f} >${TMPFILE} - egrep -q 'has errors$' ${TMPFILE} && { cat ${TMPFILE}; ret=1 ;} - else - python -m json.tool ${f} &>/dev/null || { echo "$f: has json errors"; ret=1; } - fi -done - -cat ${TMPFILE} - -exit ${ret} +true |
