summaryrefslogtreecommitdiff
path: root/python/vyos/defaults.py
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-04-11 12:55:59 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-04-11 12:55:59 +0100
commitef2e8f4d721a6486db90c0f395f595ca897614b8 (patch)
tree63963020cd60b82b007691a0885d3739c8fed998 /python/vyos/defaults.py
parent7b1a76063b15b238702cc86a71c5f0604c994920 (diff)
downloadvyos-1x-ef2e8f4d721a6486db90c0f395f595ca897614b8.tar.gz
vyos-1x-ef2e8f4d721a6486db90c0f395f595ca897614b8.zip
template: T2230: helper to generate templates
Currently the pattern is to import jinja2 and re-generate the template in every file. Dimitriy reported a reduction in performance (1s) when commiting. This code provide an helper function which caches the Environment and template renderer, and can generate template from one line (instead of the few currently)
Diffstat (limited to 'python/vyos/defaults.py')
-rw-r--r--python/vyos/defaults.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/python/vyos/defaults.py b/python/vyos/defaults.py
index a2ad142bc..88894674f 100644
--- a/python/vyos/defaults.py
+++ b/python/vyos/defaults.py
@@ -21,6 +21,7 @@ directories = {
"current": "/opt/vyatta/etc/config-migrate/current",
"migrate": "/opt/vyatta/etc/config-migrate/migrate",
"log": "/var/log/vyatta",
+ "templates": "/usr/share/vyos/templates/"
}
cfg_group = 'vyattacfg'