Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate configuration-custom.json syntax before deployment starts #38

Open
wcbdata opened this issue Jun 13, 2018 · 0 comments
Open

Validate configuration-custom.json syntax before deployment starts #38

wcbdata opened this issue Jun 13, 2018 · 0 comments

Comments

@wcbdata
Copy link

wcbdata commented Jun 13, 2018

When configuration-custom.json is modified, there is a chance it will be invalid. If the JSON is within a script or generated at runtime, the json usually isn't validated before being passed to deploy-recommended-cluster.bash. Failure due to malformed json is a bit opaque from the error messages, and can be labor-intensive to recover from after other parts of ambari-bootstrap have already run.

Using something like the example below at the earliest point that makes sense could make the script more restartable in the event of a malformed json file:

`#Check validity of configuration-custom.json

if jq '.' configuration-custom.json; then
echo "JSON file is valid ..."
else
echo "Custom config JSON file is invalid! Please fix the source script ..." 1>&2
exit 1
fi`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant