[pve-devel] applied: [PATCH proxmox] notify: make template rendering helpers more robust

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Aug 25 15:35:19 CEST 2023


Am 25/08/2023 um 13:35 schrieb Lukas Wagner:
> This commit has the aim of making template rendering a bit more
> robust. It does so by a.) Accepting also strings for helpers that
> expect a number, parsing the number if needed, and b.) Ignoring errors
> if a template helper fails to render a value and showing an error in
> the logs, instead of failing to render the whole template (leading
> to no notification being sent).
> 
> Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
> ---
> 
>  proxmox-notify/examples/render.rs        |  2 +-
>  proxmox-notify/src/renderer/html.rs      |  2 +-
>  proxmox-notify/src/renderer/mod.rs       | 58 ++++++++++++++++++------
>  proxmox-notify/src/renderer/plaintext.rs |  4 +-
>  4 files changed, 49 insertions(+), 17 deletions(-)
> 
>

applied, thanks!





More information about the pve-devel mailing list