file module: mode formatting & directory ownership

reviewable/pr18780/r1
Matthew Williams 13 years ago
parent a3bd951bfb
commit ac85f48871

@ -152,7 +152,7 @@ def set_mode_if_different(path, mode, changed):
return changed
try:
# FIXME: support English modes
mode = int("0%s" % mode)
mode = int(mode, 8)
except Exception, 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
changed = set_context_if_different(path, secontext, changed)
changed = set_owner_if_different(path, owner, changed)
changed = set_group_if_different(path, owner, changed)
changed = set_mode_if_different(path, owner, changed)
changed = set_group_if_different(path, group, changed)
changed = set_mode_if_different(path, mode, changed)
exit_json(path=path, changed=changed)

Loading…
Cancel
Save