find: skip ENOENT while enumerating files (#84877)

* 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>
pull/84887/head
Abhijeet Kasurde 9 months ago committed by GitHub
parent 1e5aac7b4f
commit 5280850130
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).

@ -515,7 +515,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