mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix issue where only one of the group or user is passed
This commit is contained in:
parent
1a4f244a88
commit
8f318549cf
1 changed files with 7 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue