find: explicit empty excludes causes find to exclude everything #70640
Labels
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.
P3
Priority 3 - Approved, No Time Limitation
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
verified
This issue has been verified/reproduced by maintainer
SUMMARY
When using
find
with emptyexcludes
list, it excludes everything, yet if you remove that emptyexcludes
entirely, thefind
behaves correctly (nothing is excluded).ISSUE TYPE
COMPONENT NAME
find
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
RHEL 7.7
STEPS TO REPRODUCE
Run
find
task withexcludes: [ ]
and see that the results come back empty - everything is excluded. But if you remove thatexcludes: [ ]
then find results come back correctly.Run that playbook via
ansible-playbook playbook.yaml
and see the results of find is empty - 0 files are returned:Now edit that playbook and completely delete the
excludes: [ ]
line and re-run it. Now see it returns the correct two files:EXPECTED RESULTS
I expect an empty
excludes
list to behave identically as whenexcludes
list is completely not specified. An empty excludes list should mean, "I do not want to exclude anything".ACTUAL RESULTS
All files are excluded if I specify an empty list in
excludes
but this is wrong - that should definitely not mean "I want to exclude EVERYTHING".The text was updated successfully, but these errors were encountered: