def user_exists(name, runas=None):
    if runas is None:
        runas = salt.utils.get_user()
    user_list = list_users(runas=runas)
    log.debug(user_list)

    return name in user_list
Return whether the user exists based on rabbitmqctl list_users.
dataset/ETHPy150Open saltstack/salt/salt/modules/rabbitmq.py/user_exists