-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
As discussed in quattor/configuration-modules-core#1413, we often end up with blocks of TT code along the lines of:
[%- IF CCM.is_boolean(pair.value) -%]
[% pair.value ? 'yes' : 'no' %]
[%- ELSIF CCM.is_list(pair.value) -%]
[% pair.value.join(' ') %]
[%- ELSE -%]
[% pair.value %]
[%- END %]
These might be tidier if the type could be used with SWITCH:
[%- SWITCH CCM.type(pair.key) -%]
[%- CASE 'boolean' -%]
[% pair.value ? 'yes' : 'no' %]
[%- CASE 'list' -%]
[% pair.value.join(' ') %]
[%- CASE -%]
[% pair.value %]
[%- END %]
Reactions are currently unavailable