diff options
author | Joshua Harlow <harlowja@gmail.com> | 2012-11-08 08:55:04 -0800 |
---|---|---|
committer | Joshua Harlow <harlowja@gmail.com> | 2012-11-08 08:55:04 -0800 |
commit | d8e82fb7bc9da6259b158804ae3d8343050c67aa (patch) | |
tree | 3547ed6d4344aef8d1d5dde71e42b30474897bd9 | |
parent | 7ea02ab1d8ee0f400a84ee2d688e67ffbc449bf0 (diff) | |
download | vyos-cloud-init-d8e82fb7bc9da6259b158804ae3d8343050c67aa.tar.gz vyos-cloud-init-d8e82fb7bc9da6259b158804ae3d8343050c67aa.zip |
Add non-zero exit code when
bad yamls are found instead
of returning zero in that case.
-rwxr-xr-x | tools/validate-yaml.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/validate-yaml.py b/tools/validate-yaml.py index d3218e40..eda59cb8 100755 --- a/tools/validate-yaml.py +++ b/tools/validate-yaml.py @@ -9,6 +9,7 @@ import yaml if __name__ == "__main__": + bads = 0 for fn in sys.argv[1:]: sys.stdout.write("%s" % (fn)) try: @@ -18,3 +19,8 @@ if __name__ == "__main__": sys.stdout.write(" - ok\n") except Exception, e: sys.stdout.write(" - bad (%s)\n" % (e)) + bads += 1 + if bads > 0: + sys.exit(1) + else: + sys.exit(0) |