mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Add list_users() to pw_user (FreeBSD)
Synced list_users() from useradd.py to pw_user.py.
This commit is contained in:
parent
317ec24ccc
commit
aa00ef9ff0
@ -413,3 +413,16 @@ def list_groups(name):
|
||||
salt '*' user.list_groups foo
|
||||
'''
|
||||
return salt.utils.get_group_list(name)
|
||||
|
||||
|
||||
def list_users():
|
||||
'''
|
||||
Return a list of all users
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' user.list_users
|
||||
'''
|
||||
return sorted([user.pw_name for user in pwd.getpwall()])
|
||||
|
Loading…
Reference in New Issue
Block a user