better chown errors

(cherry picked from commit a6e27a903a)
pull/31393/merge
Brian Coca 8 years ago
parent e80c7d55d8
commit d2c19eb2f1

@ -104,6 +104,7 @@ Ansible Changes By Release
https://github.com/ansible/ansible/issues/24169
* Do not log data field in `docker_secrets` module (https://github.com/ansible/ansible/pull/31366)
* Fix rpm_key taking the wrong 8 chars from the keyid (https://github.com/ansible/ansible/pull/31045)
* chown errors now more informative
<a id="2.4"></a>

@ -1133,9 +1133,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

Loading…
Cancel
Save