Updating bsd_shadow to match mainline shadow

- added del_password method; merged from shadow
 - addresses #28382
This commit is contained in:
Christer Edwards 2015-10-28 21:14:14 -06:00 committed by rallytime
parent cd632f798d
commit c5c66b8bab

View file

@ -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