Age | Commit message (Collapse) | Author |
|
|
|
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.
|
|
|
|
convert all call to jinja to use template.render
|
|
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)
|