From 9a2e64b76d2a4a2e6501365a9c6f26e241fb6ec5 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 11 May 2015 13:18:05 -0400 Subject: [PATCH] generic fix for Exceptions that heppen when trying to set permissions on extracted files fixes ansible/ansible#10934 which is really a corner case --- files/unarchive.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/unarchive.py b/files/unarchive.py index ef30dc36122..625989ffdfb 100644 --- a/files/unarchive.py +++ b/files/unarchive.py @@ -303,7 +303,10 @@ def main(): # do we need to change perms? for filename in handler.files_in_archive: file_args['path'] = os.path.join(dest, filename) - res_args['changed'] = module.set_fs_attributes_if_different(file_args, res_args['changed']) + try: + res_args['changed'] = module.set_fs_attributes_if_different(file_args, res_args['changed']) + except (IOError, OSError), e: + module.fail_json(msg="Unexpected error when accessing exploded file: %s" % str(e)) if module.params['list_files']: res_args['files'] = handler.files_in_archive