mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Updating bsd_shadow to match mainline shadow
- added del_password method; merged from shadow - addresses #28382
This commit is contained in:
parent
cd632f798d
commit
c5c66b8bab
1 changed files with 18 additions and 0 deletions
|
@ -120,6 +120,24 @@ def set_expire(name, expire):
|
|||
return post_info['expire'] == expire
|
||||
|
||||
|
||||
def del_password(name):
|
||||
'''
|
||||
.. versionadded:: 2015.8.3
|
||||
|
||||
Delete the password from name user
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' shadow.del_password username
|
||||
'''
|
||||
cmd = 'pw user mod {0} -w none'.format(name)
|
||||
__salt__['cmd.run'](cmd, python_shell=False, output_loglevel='quiet')
|
||||
uinfo = info(name)
|
||||
return not uinfo['passwd']
|
||||
|
||||
|
||||
def set_password(name, password):
|
||||
'''
|
||||
Set the password for a named user. The password must be a properly defined
|
||||
|
|
Loading…
Add table
Reference in a new issue