I have a collection of namedtuples which looks like this :
[('mountpoint=X',state='UP'),(mountpoint='Y',state='DOWN'),(mountpoint='Z',state='DOWN'...)]
I pass this collection to one of my templates. I'd like to filter that collection based on state. Tried the following to no avail
{% for state in states|selectattr('state','down') %}
TemplateRuntimeError: no test named 'down'
{% for state in states|selectattr(state='down') %}
FilterArgumentError: Missing parameter for attribute name
{% for state in states|select(state='down') %}
No error, but doesn't filter at all.