Ansible repository with playbooks to manage azure objects
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

19 righe
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)