I have an output as follows:
[{
'stderr': 'error: cannot open file',
},
{
'stderr': '',
}]
Jinja snipper:
{{ php_command_result.results | map(attribute='stderr') | sort | join('\r - ') }}"
Returns a trailing -
at the end because stderr
is empty. How can I ignore empty values?
Did you try rejectattr?