def present(name, passwd, database=None, user=None, password=None, host=None,
            port=None):
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': ''}

    # check if db does not exist
    if database and not __salt__['influxdb.db_exists'](
            database, user, password, host, port):
        ret['result'] = False
        ret['comment'] = 'Database {0} does not exist'.format(database)
        return ret

    # check if user exists
    if not __salt__['influxdb.user_exists'](
            name, database, user, password, host, port):
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'User {0} is not present and needs to be created'\
                .format(name)
            return ret
        # The user is not present, make it!
        if __salt__['influxdb.user_create'](
                name, passwd, database, user, password, host, port):
            ret['comment'] = 'User {0} has been created'.format(name)
            ret['changes'][name] = 'Present'
            return ret
        else:
            ret['comment'] = 'Failed to create user {0}'.format(name)
            ret['result'] = False
            return ret

    # fallback
    ret['comment'] = 'User {0} is already present'.format(name)
    return ret
Helper parse action for removing quotation marks from parsed quoted strings.
dataset/ETHPy150Open saltstack/salt/salt/states/influxdb_user.py/present--crossover with--dataset/ETHPy150Open ipython/ipython-py3k/IPython/external/pyparsing/_pyparsing.py/removeQuotes