Ansible repository with playbooks to manage azure objects
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

19 satır
478 B

  1. #!/usr/bin/env python3
  2. # filename: check_jinja_syntax.py
  3. import sys
  4. import os
  5. from jinja2 import Environment, FileSystemLoader
  6. #for arg in sys.argv:
  7. # print(arg)
  8. env = Environment(loader=FileSystemLoader(sys.argv[1]))
  9. #templates = []
  10. #for x in env.list_templates():
  11. # if x.endswith('.j2'):
  12. # templates.append(x)
  13. templates = [x for x in env.list_templates() if x.endswith('.j2')]
  14. for template in templates:
  15. print(template)
  16. t = env.get_template(template)
  17. env.parse(t)