summaryrefslogtreecommitdiff
path: root/python/vyos/template.py
AgeCommit message (Collapse)Author
2020-07-03ntp: T2676: mive to get_config_dict()Christian Poessinger
2020-07-03vyos.template: T2676: add custom Jinja2 filter for IP handlingChristian Poessinger
NTP configuration file requires the IP address and a netmask for client subnets but the CLI will only provide a prefix based ntoation. Use custom, reusable JInja2 template to transform a CIDR based prefix into its address and netmask portion for IPv4 and IPv6. Jinja2 custom filters are regular python functions - thus they can be re-used directly when e.g. verifying the configuration in vyos-smoketests.
2020-04-27template: T2388: move mkdir/chmod/chown within render()Thomas Mangin
2020-04-12template: T2230: use render to generate templatesThomas Mangin
convert all call to jinja to use template.render
2020-04-11template: T2230: helper to generate templatesThomas Mangin
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)