Add list_users() to pw_user (FreeBSD)

Synced list_users() from useradd.py to pw_user.py.
This commit is contained in:
Toni Ylenius 2014-08-23 12:39:19 +03:00
parent 317ec24ccc
commit aa00ef9ff0

View File

@ -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()])