Fix issue where only one of the group or user is passed

This commit is contained in:
Thomas S Hatch 2012-03-13 09:11:41 -06:00
parent 1a4f244a88
commit 8f318549cf

View file

@ -338,6 +338,9 @@ template_registry = {
def _check_perms(name, ret, user, group, mode):
'''
Check the permissions on files and chown if needed
'''
# Check permissions
perms = {}
perms['luser'] = __salt__['file.get_user'](name)
@ -363,6 +366,10 @@ def _check_perms(name, ret, user, group, mode):
perms['cgroup'] = group
if 'cuser' in perms or 'cgroup' in perms:
if not __opts__['test']:
if user is None:
user = perms['luser']
if group is None:
group = perms['lgroup']
__salt__['file.chown'](
name,
user,