From a6e27a903aeded6b3d71e1995fcbfdfaa0f7c04d Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 2 Oct 2017 15:51:40 -0400 Subject: [PATCH] better chown errors --- lib/ansible/module_utils/basic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 8124eb9a70..18f1e5c0db 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1132,9 +1132,9 @@ class AnsibleModule(object): return True try: os.lchown(b_path, uid, -1) - except OSError: + except (IOError, OSError) as e: path = to_text(b_path) - self.fail_json(path=path, msg='chown failed') + self.fail_json(path=path, msg='chown failed: %s' % (to_text(e))) changed = True return changed