def list_(bank, cachedir):
    '''
    Return an iterable object containing all entries stored in the specified bank.
    '''
    base = os.path.join(cachedir, os.path.normpath(bank))
    if not os.path.isdir(base):
        return []
    try:
        items = os.listdir(base)
    except OSError as exc:
        raise SaltCacheError(
            'There was an error accessing directory "{0}": {1}'.format(
                base, exc
            )
        )
    ret = []
    for item in items:
        if item.endswith('.p'):
            ret.append(item.rstrip(item[-2:]))
        else:
            ret.append(item)
    return ret