summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-11-07 21:00:33 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-11-07 21:00:33 -0800
commit7ea02ab1d8ee0f400a84ee2d688e67ffbc449bf0 (patch)
treec0f9a22bbf923239a99261a5e9871f5f48fbc616 /tools
parent1e6fc277a1c8d695c37741cc31f5ddab3d5b5600 (diff)
downloadvyos-cloud-init-7ea02ab1d8ee0f400a84ee2d688e67ffbc449bf0.tar.gz
vyos-cloud-init-7ea02ab1d8ee0f400a84ee2d688e67ffbc449bf0.zip
Add a makefile yaml checking target
and fix the cases where the cc yaml is not correct.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/validate-yaml.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/validate-yaml.py b/tools/validate-yaml.py
new file mode 100755
index 00000000..d3218e40
--- /dev/null
+++ b/tools/validate-yaml.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+"""Try to read a YAML file and report any errors.
+"""
+
+import sys
+
+import yaml
+
+
+if __name__ == "__main__":
+ for fn in sys.argv[1:]:
+ sys.stdout.write("%s" % (fn))
+ try:
+ fh = open(fn, 'r')
+ yaml.safe_load(fh.read())
+ fh.close()
+ sys.stdout.write(" - ok\n")
+ except Exception, e:
+ sys.stdout.write(" - bad (%s)\n" % (e))