Exemplo n.º 1
0
def test_lookup_alive_tags_shallow(initialized_db):
    found = False
    for tag in filter_to_visible_tags(filter_to_alive_tags(Tag.select())):
        tags = lookup_alive_tags_shallow(tag.repository)
        found = True
        assert tag in tags

    assert found

    # Ensure hidden tags cannot be listed.
    tag = Tag.get()
    tag.hidden = True
    tag.save()

    tags = lookup_alive_tags_shallow(tag.repository)
    assert tag not in tags
Exemplo n.º 2
0
def delete_obsolete_tags(mirror, tags):
    existing_tags = lookup_alive_tags_shallow(mirror.repository.id)
    obsolete_tags = list([tag for tag in existing_tags if tag.name not in tags])

    for tag in obsolete_tags:
        delete_tag(mirror.repository, tag.name)

    return obsolete_tags
Exemplo n.º 3
0
def delete_obsolete_tags(mirror, tags):
    existing_tags = lookup_alive_tags_shallow(mirror.repository.id)
    obsolete_tags = list(filter(lambda tag: tag.name not in tags, existing_tags))

    for tag in obsolete_tags:
        delete_tag(mirror.repository, tag.name)

    return obsolete_tags
Exemplo n.º 4
0
def delete_obsolete_tags(mirror, tags):
    existing_tags = lookup_alive_tags_shallow(mirror.repository.id)
    obsolete_tags = list(
        [tag for tag in existing_tags if tag.name not in tags])

    for tag in obsolete_tags:
        logger.debug("Repo mirroring delete obsolete tag '%s'" % tag.name)
        delete_tag(mirror.repository, tag.name)

    return obsolete_tags