Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make import_dashboards have non-zero exit code on error (#3252)
* Always set exit status of 1 on error Previously, a failure in ImportKibana or ImportArchive methods would print an error, but the exit status would be set to 0. In addition, the ImportDir method would return nil instead of an error when asked to import a directory which did not exist. This would end up printing several error messages to the console but ultimately causing an exit status of 0. * Fix English grammar in errors with s/fail/failed/ Most of the error messages were things like "fail to" which reads better as "failed to". * Use assertEqual to check the return code from import_dashboards The test failure message now includes the stdout & stderr output from the script for easier debugging. * Look for Kibana index in _meta/kibana, not etc/kibana * Fix spelling of "visualization" in status message * Make ImportKibana and ImportDir smarter about missing dirs If someone passes a -dir that doesn't exist at all, that's an error. If the dir does exist but it does not have either an index-pattern or dashboard subdir, that is also an error. Similarly, if they request -only-index or --only-dashboards and the corresponding subdir doesn't exist that's an error. We check all of this in ImportKibana, so we no longer pass non-existent subdirs to ImportDir, meaning it can assume that the dir exists. * Standardize error message casing and use of periods I also added a little more detail to a few error messages and tweaked the grammar in a few spots. * Send all error output to os.stderr * Add a -quiet option to to suppress all status messages * Skip the dashboard import test entirely for now (see #3370)
- Loading branch information