[bp-2.18] find: skip ENOENT while enumerating files (#84886)

* skip 'no such file or directory' error code while files and
  directories and report them.

Fixes: #84873

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
(cherry picked from commit 5280850130)
pull/84957/head
Abhijeet Kasurde 9 months ago committed by GitHub
parent 8c03e3a74a
commit 27d6a409dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
bugfixes:
- find - skip ENOENT error code while recursively enumerating files.
find module will now be tolerant to race conditions that remove files or directories
from the target it is currently inspecting. (https://github.com/ansible/ansible/issues/84873).

@ -513,7 +513,7 @@ def main():
skipped = {}
def handle_walk_errors(e):
if e.errno in (errno.EPERM, errno.EACCES):
if e.errno in (errno.EPERM, errno.EACCES, errno.ENOENT):
skipped[e.filename] = to_text(e)
return
raise e

Loading…
Cancel
Save