Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter does not fail when is missing #66721

Closed
mnecas opened this issue Jan 23, 2020 · 3 comments · Fixed by #68047
Closed

Filter does not fail when is missing #66721

mnecas opened this issue Jan 23, 2020 · 3 comments · Fixed by #68047
Assignees
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. files Files category P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@mnecas
Copy link
Contributor

mnecas commented Jan 23, 2020

SUMMARY

Hi,
I noticed that the ansible filter does not fail when you use it like this test.test.list even that the filter does not exist.
Im not sure if its by design or if its an issue.
Mainly it could be issue when creating collections and mistype the name.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

filter

ANSIBLE VERSION
ansible 2.9.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
OS / ENVIRONMENT

CentOS Linux release 7.7.1908 (Core)

STEPS TO REPRODUCE
  1. test.test.list or test.list does not exist
  2. run this playbook
---
- name: name
  hosts: localhost
  vars:
    var_name:
      something: test
  tasks:
    - debug:
        msg: "{{ var_name | test.test.list }}"
#works 
    - debug:
        msg: "{{ var_name | test.list }}"
#fails 
EXPECTED RESULTS

Show error when the filter is not found.

ACTUAL RESULTS

Debug msg: "{{ var_name | test.test.list }}"


@ansibot
Copy link
Contributor

ansibot commented Jan 23, 2020

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. files Files category module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jan 23, 2020
@sivel
Copy link
Member

sivel commented Feb 11, 2020

!component =lib/ansible/utils/collection_loader.py

cc @nitzmahone

@sivel sivel added P3 Priority 3 - Approved, No Time Limitation and removed needs_triage Needs a first human triage before being processed. labels Feb 11, 2020
@ansibot
Copy link
Contributor

ansibot commented Feb 11, 2020

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot removed the module This issue/PR relates to a module. label Feb 11, 2020
@sivel sivel self-assigned this Mar 5, 2020
sivel added a commit to sivel/ansible that referenced this issue Mar 5, 2020
sivel added a commit that referenced this issue Mar 23, 2020
…68047)

* Address fixme and handle fitler/test errors for collections better. Fixes #66721

* Re-arrange code
@ansible ansible locked and limited conversation to collaborators Apr 20, 2020
sivel added a commit to sivel/ansible that referenced this issue Apr 28, 2020
…ons better (ansible#68047)

* Address fixme and handle fitler/test errors for collections better. Fixes ansible#66721

* Re-arrange code
(cherry picked from commit ee6413a)

Co-authored-by: Matt Martz <matt@sivel.net>
mattclay pushed a commit that referenced this issue May 6, 2020
…ons better (#68047)

* Address fixme and handle fitler/test errors for collections better. Fixes #66721

* Re-arrange code
(cherry picked from commit ee6413a)

Co-authored-by: Matt Martz <matt@sivel.net>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. files Files category P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants