diff options
Diffstat (limited to 'lib/ansible/modules/find.py')
-rw-r--r-- | lib/ansible/modules/find.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/ansible/modules/find.py b/lib/ansible/modules/find.py index d2e6c8b..0251224 100644 --- a/lib/ansible/modules/find.py +++ b/lib/ansible/modules/find.py @@ -258,6 +258,7 @@ skipped_paths: version_added: '2.12' ''' +import errno import fnmatch import grp import os @@ -434,10 +435,6 @@ def statinfo(st): } -def handle_walk_errors(e): - raise e - - def main(): module = AnsibleModule( argument_spec=dict( @@ -482,6 +479,12 @@ def main(): filelist = [] skipped = {} + def handle_walk_errors(e): + if e.errno in (errno.EPERM, errno.EACCES): + skipped[e.filename] = to_text(e) + return + raise e + if params['age'] is None: age = None else: |