Skip to content

Commit 04dd721

Browse files
committed
Fix catalog compilation when no mappings are passed
Only attempt to compute the longest key of mappings when mappings are actually passed.
1 parent 1deae36 commit 04dd721

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

templates/conf.d/map.epp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ map <%= $string %> $<%= $name %> {
1717
<%- $include_files.each |$h| { -%>
1818
include <%= $h %>;
1919
<%- } -%>
20+
<%- unless $mappings.empty { -%>
2021

2122
<%-
2223
$m = $mappings ? {
@@ -28,4 +29,5 @@ $field_width = $m.map |$x| { $x['key'].length }.max
2829
<%- $m.each |$h| { -%>
2930
<%= sprintf("%-*s %s", $field_width, $h['key'], $h['value']) %>;
3031
<%- } -%>
32+
<%- } -%>
3133
}

0 commit comments

Comments
 (0)