summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2012-11-08 08:55:04 -0800
committerJoshua Harlow <harlowja@gmail.com>2012-11-08 08:55:04 -0800
commitd8e82fb7bc9da6259b158804ae3d8343050c67aa (patch)
tree3547ed6d4344aef8d1d5dde71e42b30474897bd9
parent7ea02ab1d8ee0f400a84ee2d688e67ffbc449bf0 (diff)
downloadvyos-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-xtools/validate-yaml.py6
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)