-
-
Save deeheber/effd5873050e3b4b01b74a54dd4c329f to your computer and use it in GitHub Desktop.
Simple script to test format validity of yaml files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import yaml | |
# sample usage: | |
# user@shell$ python3 yams_test.py file1.yaml file2.yaml file3.yaml | |
print(sys.argv) | |
for fname in sys.argv[1:]: | |
fin = open(fname, 'r') | |
yams = fin.read() | |
fin.close() | |
try: | |
yaml.load(yams) | |
print('%s Success!' % (fname,)) | |
except Exception as e: | |
raise e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment