def absent(name,
           runas=None):
    '''
    Ensure the named user is absent

    name
        The name of the user to remove
    runas
        User to run the command
    '''
    ret = {'name': name, 'result': False, 'comment': '', 'changes': {}}

    try:
        user_exists = __salt__['rabbitmq.user_exists'](name, runas=runas)
    except CommandExecutionError as err:
        ret['comment'] = 'Error: {0}'.format(err)
        return ret

    if user_exists:
        if not __opts__['test']:
            try:
                __salt__['rabbitmq.delete_user'](name, runas=runas)
            except CommandExecutionError as err:
                ret['comment'] = 'Error: {0}'.format(err)
                return ret
        ret['changes'].update({'name':
                              {'old': name,
                               'new': ''}})
    else:
        ret['result'] = True
        ret['comment'] = 'The user \'{0}\' is not present.'.format(name)
        return ret

    if __opts__['test'] and ret['changes']:
        ret['result'] = None
        ret['comment'] = 'The user \'{0}\' will be removed.'.format(name)
        return ret

    ret['result'] = True
    ret['comment'] = 'The user \'{0}\' was removed.'.format(name)
    return ret
def absent ( name , runas = None ) : ret = { 'name' : name , 'result' : False , 'comment' : '' , 'changes' : { } } try : user_exists = __salt__ [ 'rabbitmq.user_exists' ] ( name , runas = runas ) except CommandExecutionError as err : ret [ 'comment' ] = 'Error: {0}' . format ( err ) return ret if user_exists : if not __opts__ [ 'test' ] : try : __salt__ [ 'rabbitmq.delete_user' ] ( name , runas = runas ) except CommandExecutionError as err : ret [ 'comment' ] = 'Error: {0}' . format ( err ) return ret ret [ 'changes' ] . update ( { 'name' : { 'old' : name , 'new' : '' } } ) else : ret [ 'result' ] = True ret [ 'comment' ] = 'The user \'{0}\' is not present.' . format ( name ) return ret if __opts__ [ 'test' ] and ret [ 'changes' ] : ret [ 'result' ] = None ret [ 'comment' ] = 'The user \'{0}\' will be removed.' . format ( name ) return ret ret [ 'result' ] = True ret [ 'comment' ] = 'The user \'{0}\' was removed.' . format ( name ) return ret
Ensure the named user is absent

    name
        The name of the user to remove
    runas
        User to run the command