mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
better chown errors
This commit is contained in:
@@ -1132,9 +1132,9 @@ class AnsibleModule(object):
|
|||||||
return True
|
return True
|
||||||
try:
|
try:
|
||||||
os.lchown(b_path, uid, -1)
|
os.lchown(b_path, uid, -1)
|
||||||
except OSError:
|
except (IOError, OSError) as e:
|
||||||
path = to_text(b_path)
|
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
|
changed = True
|
||||||
return changed
|
return changed
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user