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

changed missing file error to warning for lookups #16800

Merged
merged 2 commits into from Sep 20, 2016

Conversation

bcoca
Copy link
Member

@bcoca bcoca commented Jul 22, 2016

ISSUE TYPE
  • Bugfix Pull Request
ANSIBLE VERSION
2.2
SUMMARY

This should reestablish the old behavior skipping loops instead of creating errors.

fixes #16801

@mattclay
Copy link
Member

@bcoca This change breaks with_first_found. The test is failing because the task test with_first_found in test_iterators is now returning null instead of the first item found.

@bcoca
Copy link
Member Author

bcoca commented Sep 16, 2016

is test correct? this change avoids an exception that ends up giving back 'the first item' from first found, not actually that it found the file

@mattclay
Copy link
Member

The test is correct: https://github.com/ansible/ansible/blob/devel/test/integration/roles/test_iterators/tasks/main.yml#L187

Also, there are other tests failing from this change: https://app.shippable.com/runs/57dab579eef88d1000043437/12/console

That one fails on an include using with_first_found to find the path when the file doesn't exist.

@bcoca
Copy link
Member Author

bcoca commented Sep 19, 2016

That one fails on an include using with_first_found to find the path when the file doesn't exist.

Isn't that the point? nvmd, misunderstood, fixed the lookup to not ignore the exception but deal with the None.

warning will still be displayed, they now work with None value
@bcoca bcoca merged commit 1e4e188 into ansible:devel Sep 20, 2016
@bcoca bcoca deleted the lookup_warn_on_missing branch September 20, 2016 20:38
sereinity pushed a commit to sereinity-forks/ansible that referenced this pull request Jan 25, 2017
* changed missing file error to warning for lookups

* changed plugins that expected exception

warning will still be displayed, they now work with None value
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 5, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

with_fileglob no longer returns an empty list
4 participants