mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-21 12:27:17 +03:00
Check jinja templates for syntax error (#10667)
Allow to fail early (pre-commit time) for jinja error, rather than waiting until executing the playbook and the invalid template. I could not find a simple jinja pre-commit hook in the wild.
This commit is contained in:
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
from jinja2 import Environment
|
||||
|
||||
env = Environment()
|
||||
for template in sys.argv[1:]:
|
||||
with open(template) as t:
|
||||
env.parse(t.read())
|
||||
Reference in New Issue
Block a user