Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Renaming _type to pulp_type
Browse files Browse the repository at this point in the history
  • Loading branch information
fao89 committed Oct 9, 2019
1 parent 08f4b06 commit d6f1c28
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGES/5454.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change `_type` to `pulp_type`
2 changes: 1 addition & 1 deletion pulp_docker/app/tasks/recursive_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def recursive_add_content(repository_pk, content_units):
latest_version = RepositoryVersion.latest(repository)
if latest_version:
tags_in_repo = latest_version.content.filter(
_type="docker.tag"
pulp_type="docker.tag"
)
tags_to_replace = Tag.objects.filter(
pk__in=tags_in_repo,
Expand Down
6 changes: 3 additions & 3 deletions pulp_docker/app/tasks/recursive_remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ def recursive_remove_content(repository_pk, content_units):
latest_version = RepositoryVersion.latest(repository)
latest_content = latest_version.content.all() if latest_version else Content.objects.none()

tags_in_repo = Q(pk__in=latest_content.filter(_type='docker.tag'))
manifests_in_repo = Q(pk__in=latest_content.filter(_type='docker.manifest'))
tags_in_repo = Q(pk__in=latest_content.filter(pulp_type='docker.tag'))
manifests_in_repo = Q(pk__in=latest_content.filter(pulp_type='docker.manifest'))
user_provided_content = Q(pk__in=content_units)
type_manifest_list = Q(media_type=MEDIA_TYPE.MANIFEST_LIST)
type_manifest = Q(media_type__in=[MEDIA_TYPE.MANIFEST_V1, MEDIA_TYPE.MANIFEST_V2])
blobs_in_repo = Q(pk__in=latest_content.filter(_type='docker.blob'))
blobs_in_repo = Q(pk__in=latest_content.filter(pulp_type='docker.blob'))

# Tags do not have must_remain because they are the highest level content.
tags_to_remove = Tag.objects.filter(user_provided_content & tags_in_repo)
Expand Down
2 changes: 1 addition & 1 deletion pulp_docker/app/tasks/untag.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def untag_image(tag, repository_pk):
latest_version = RepositoryVersion.latest(repository)

tags_in_latest_repository = latest_version.content.filter(
_type="docker.tag"
pulp_type="docker.tag"
)

tags_to_remove = Tag.objects.filter(
Expand Down
4 changes: 2 additions & 2 deletions pulp_docker/app/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def create(self, request):
source_latest = serializer.validated_data['source_repository_version']
destination = serializer.validated_data['destination_repository']
content_tags_in_repo = source_latest.content.filter(
_type="docker.tag"
pulp_type="docker.tag"
)
tags_in_repo = models.Tag.objects.filter(
pk__in=content_tags_in_repo,
Expand Down Expand Up @@ -335,7 +335,7 @@ def create(self, request):
source_latest = serializer.validated_data['source_repository_version']
destination = serializer.validated_data['destination_repository']
content_manifests_in_repo = source_latest.content.filter(
_type="docker.manifest"
pulp_type="docker.manifest"
)
manifests_in_repo = models.Manifest.objects.filter(
pk__in=content_manifests_in_repo,
Expand Down

0 comments on commit d6f1c28

Please sign in to comment.