mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 10:40:22 -07:00
file module: mode formatting & directory ownership
This commit is contained in:
parent
5764ccdb0e
commit
c5a02048d2
1 changed files with 3 additions and 3 deletions
|
@ -152,7 +152,7 @@ def set_mode_if_different(path, mode, changed):
|
||||||
return changed
|
return changed
|
||||||
try:
|
try:
|
||||||
# FIXME: support English modes
|
# FIXME: support English modes
|
||||||
mode = int("0%s" % mode)
|
mode = int(mode, 8)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
fail_json(path=path, msg='mode needs to be something octalish', details=str(e))
|
fail_json(path=path, msg='mode needs to be something octalish', details=str(e))
|
||||||
|
|
||||||
|
@ -233,8 +233,8 @@ elif state == 'directory':
|
||||||
# set modes owners and context as needed
|
# set modes owners and context as needed
|
||||||
changed = set_context_if_different(path, secontext, changed)
|
changed = set_context_if_different(path, secontext, changed)
|
||||||
changed = set_owner_if_different(path, owner, changed)
|
changed = set_owner_if_different(path, owner, changed)
|
||||||
changed = set_group_if_different(path, owner, changed)
|
changed = set_group_if_different(path, group, changed)
|
||||||
changed = set_mode_if_different(path, owner, changed)
|
changed = set_mode_if_different(path, mode, changed)
|
||||||
|
|
||||||
exit_json(path=path, changed=changed)
|
exit_json(path=path, changed=changed)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue