mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
BUGFIX: Argument order pw usermod
command.
The argument order of `pw usermod` is[1]: pw [-V etcdir] usermod [name|uid] This was incorrect for the `chhome` function. The updated version is tested on FreeBSD. [1]: http://www.freebsd.org/cgi/man.cgi?query=pw&sektion=8
This commit is contained in:
parent
ec1f0f46e4
commit
1aff68a361
@ -234,17 +234,15 @@ def chhome(name, home, persist=False):
|
||||
pre_info = info(name)
|
||||
if home == pre_info['home']:
|
||||
return True
|
||||
cmd = 'pw usermod -d {0} '.format(home)
|
||||
cmd = 'pw usermod {0} -d {1}'.format(name, home)
|
||||
if persist:
|
||||
cmd += ' -m '
|
||||
cmd += name
|
||||
__salt__['cmd.run'](cmd)
|
||||
post_info = info(name)
|
||||
if post_info['home'] != pre_info['home']:
|
||||
return post_info['home'] == home
|
||||
return False
|
||||
|
||||
|
||||
def chgroups(name, groups, append=False):
|
||||
'''
|
||||
Change the groups this user belongs to, add append to append the specified
|
||||
|
Loading…
Reference in New Issue
Block a user