mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
pw_group shell migration
This commit is contained in:
parent
bc9f0edd1f
commit
f79e1db97c
@ -49,7 +49,7 @@ def add(name, gid=None, **kwargs):
|
||||
if gid:
|
||||
cmd += '-g {0} '.format(gid)
|
||||
cmd = '{0} -n {1}'.format(cmd, name)
|
||||
ret = __salt__['cmd.run_all'](cmd)
|
||||
ret = __salt__['cmd.run_all'](cmd, python_shell=False)
|
||||
|
||||
return not ret['retcode']
|
||||
|
||||
@ -64,7 +64,7 @@ def delete(name):
|
||||
|
||||
salt '*' group.delete foo
|
||||
'''
|
||||
ret = __salt__['cmd.run_all']('pw groupdel {0}'.format(name))
|
||||
ret = __salt__['cmd.run_all']('pw groupdel {0}'.format(name), python_shell=False)
|
||||
|
||||
return not ret['retcode']
|
||||
|
||||
@ -124,7 +124,7 @@ def chgid(name, gid):
|
||||
if gid == pre_gid:
|
||||
return True
|
||||
cmd = 'pw groupmod {0} -g {1}'.format(name, gid)
|
||||
__salt__['cmd.run'](cmd)
|
||||
__salt__['cmd.run'](cmd, python_shell=False)
|
||||
post_gid = __salt__['file.group_to_gid'](name)
|
||||
if post_gid != pre_gid:
|
||||
return post_gid == gid
|
||||
|
Loading…
Reference in New Issue
Block a user