aboutsummaryrefslogtreecommitdiff
path: root/tools/validate-json.sh
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-10-14 19:44:51 +0000
committerGerrit Code Review <review@openstack.org>2014-10-14 19:44:51 +0000
commitec5a16dcecce315b2a3f546d19589e817a526caf (patch)
treebfeb40342cbd943f90b18a3e99caa8475ed84f6c /tools/validate-json.sh
parent358e99668282127e2aeed0b76f5714ce043c1c4b (diff)
parentbfbf1b8c9b3a0abba86474aeb72b950142723d73 (diff)
downloadkolla-ec5a16dcecce315b2a3f546d19589e817a526caf.tar.gz
kolla-ec5a16dcecce315b2a3f546d19589e817a526caf.zip
Merge "add better validation checks (part 1)"
Diffstat (limited to 'tools/validate-json.sh')
-rwxr-xr-xtools/validate-json.sh35
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