Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #364 from SaravanaStorageNetwork/check_json
Browse files Browse the repository at this point in the history
Check json format of topology.json
  • Loading branch information
jarrpa committed Sep 29, 2017
2 parents bd2a1d8 + aa94b9e commit 19ab349
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion deploy/gk-deploy
Expand Up @@ -569,13 +569,21 @@ import json
import argparse
file = open('${TOPOLOGY}', 'r')
topo = json.load(file)
try:
topo = json.load(file)
except ValueError as e:
print("Invalid json format in : %s Error: %s" % (file, e))
sys.exit(1)
for cluster in topo['clusters']:
for node in cluster['nodes']:
print(str(node['node']['hostnames']['manage'][0]))
END
)
if [[ $NODES == "Invalid json format"* ]]; then
echo -e "$NODES \nFix json format and rerun"
exit 1
fi
fi

if [[ "x${CLI}" == "x" ]]; then
Expand Down

0 comments on commit 19ab349

Please sign in to comment.