Skip to content

Commit

Permalink
better chown errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoca committed Oct 5, 2017
1 parent 7417282 commit a6e27a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ansible/module_utils/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,9 +1132,9 @@ def set_owner_if_different(self, path, owner, changed, diff=None, expand=True):
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

Expand Down

0 comments on commit a6e27a9

Please sign in to comment.