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

Handle incorrect data type in list lookup plugin #35483

Merged
merged 3 commits into from May 17, 2018

Conversation

maxamillion
Copy link
Contributor

SUMMARY

Fixes #35481

Appropriately handle the scenario where someone passes an incorrect data type to with_list or otherwise to the list lookup plugin and gracefully fail the play instead of causing a RuntimeError.

Also added integration tests to ensure we don't have this happen again.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/executor/task_executor.py

ANSIBLE VERSION
ansible 2.5.0 (lookup 24bd56df65) last updated 2018/01/29 16:56:27 (GMT -500)
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/admiller/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/admiller/src/dev/ansible/lib/ansible
  executable location = /home/admiller/.virtualenvs/ansible/bin/ansible
  python version = 2.7.14 (default, Jan 17 2018, 14:28:32) [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)]

@ansibot ansibot added bugfix_pull_request needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. labels Jan 29, 2018
@ansibot
Copy link
Contributor

ansibot commented Jan 29, 2018

The test ansible-test sanity --test no-tests-as-filters [?] failed with the following error:

Command "test/sanity/code-smell/no-tests-as-filters.py" returned exit status 1.
>>> Standard Output
Use of Ansible provided Jinja2 tests as filters is deprecated.
Please update to use `is` syntax such as `result is failed`.
./test/integration/targets/loops/tasks/main.yml:       - with_dict_passed_a_list|failed
./test/integration/targets/loops/tasks/main.yml:       - with_list_passed_a_dict|failed

The test ansible-test sanity --test pep8 [?] failed with the following error:

lib/ansible/plugins/lookup/list.py:36:1: E302 expected 2 blank lines, found 1

click here for bot help

@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Jan 29, 2018
@Akasurde Akasurde removed the needs_triage Needs a first human triage before being processed. label Jan 30, 2018
@mattclay
Copy link
Member

Sanity failures are valid. Integration test failures unrelated.

@mattclay mattclay added the ci_verified Changes made in this PR are causing tests to fail. label Jan 30, 2018
@sivel
Copy link
Member

sivel commented Jan 30, 2018

Other than the sanity tests, the changes look good.

@ansibot ansibot removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jan 30, 2018
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Feb 7, 2018
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 2, 2018
Fixes ansible#35481

Signed-off-by: Adam Miller <admiller@redhat.com>
Signed-off-by: Adam Miller <admiller@redhat.com>
Signed-off-by: Adam Miller <admiller@redhat.com>
@ansibot ansibot removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Mar 16, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 24, 2018
@maxamillion
Copy link
Contributor Author

rebuild_merge

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels May 17, 2018
@maxamillion
Copy link
Contributor Author

rebuild_merge

@ansibot ansibot added the affects_2.6 This issue/PR affects Ansible v2.6 label May 17, 2018
@maxamillion
Copy link
Contributor Author

shippable instabilities are unrelated, merging.

@maxamillion maxamillion merged commit 98a198a into ansible:devel May 17, 2018
achinthagunasekara pushed a commit to achinthagunasekara/ansible that referenced this pull request May 23, 2018
handle incorrect data type in list lookup plugin
Fixes ansible#35481
test to ensure that loops properly handle incorrect datatypes

Signed-off-by: Adam Miller <admiller@redhat.com>
jacum pushed a commit to jacum/ansible that referenced this pull request Jun 26, 2018
handle incorrect data type in list lookup plugin
Fixes ansible#35481
test to ensure that loops properly handle incorrect datatypes

Signed-off-by: Adam Miller <admiller@redhat.com>
ilicmilan pushed a commit to ilicmilan/ansible that referenced this pull request Nov 7, 2018
handle incorrect data type in list lookup plugin
Fixes ansible#35481
test to ensure that loops properly handle incorrect datatypes

Signed-off-by: Adam Miller <admiller@redhat.com>
@Akasurde Akasurde mentioned this pull request Nov 17, 2018
@ansible ansible locked and limited conversation to collaborators May 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing a dict to with_list causes RuntimeError
5 participants