From 04dd7217dc4d7aa9e855bcfcf72f45e027977898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Mon, 9 Sep 2024 16:21:24 -1000 Subject: [PATCH] Fix catalog compilation when no `mappings` are passed Only attempt to compute the longest key of mappings when mappings are actually passed. --- templates/conf.d/map.epp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/conf.d/map.epp b/templates/conf.d/map.epp index 612bc5eed..8cbb816c0 100644 --- a/templates/conf.d/map.epp +++ b/templates/conf.d/map.epp @@ -17,6 +17,7 @@ map <%= $string %> $<%= $name %> { <%- $include_files.each |$h| { -%> include <%= $h %>; <%- } -%> +<%- unless $mappings.empty { -%> <%- $m = $mappings ? { @@ -28,4 +29,5 @@ $field_width = $m.map |$x| { $x['key'].length }.max <%- $m.each |$h| { -%> <%= sprintf("%-*s %s", $field_width, $h['key'], $h['value']) %>; <%- } -%> +<%- } -%> }