You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While full blown type inference may not be feasible, it should be quite doable to catch at least some basic things, like:
selectattr | length
Where Ansible will complain with something like:
The conditional check 'dbms_postgres_reconfig.results | selectattr('changed'
) | selectattr('restart_required') | length' failed.
The error was: Unexpected templating type error occurred on ({% if dbms_postgres_reconfig.results | selectattr('changed') | selectattr('restart_required') | length %} True {% else %} False {% endif %}
):
object of type 'generator' has no len()
The error appears to be in '/home/vagrant/ansible/roles/dbms/tasks/main.yml': line 124, column
3, but may\nbe elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: restart postgres if our changes necessitate it
^ here"
Basically we can infer that the selectattr filter is a generator, and that length will not work on a generator, but needs a list.
The text was updated successfully, but these errors were encountered:
While full blown type inference may not be feasible, it should be quite doable to catch at least some basic things, like:
Where Ansible will complain with something like:
Basically we can infer that the
selectattr
filter is a generator, and thatlength
will not work on agenerator
, but needs alist
.The text was updated successfully, but these errors were encountered: