Skip to content

Commit

Permalink
Fixes bug where replication task would delete repositories accross do…
Browse files Browse the repository at this point in the history
…mains.

fixes: pulp#4158
  • Loading branch information
dkliban committed Jul 26, 2023
1 parent 51025e9 commit f9a2e1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/4158.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug where repositories were getting deleted accross domains.
4 changes: 2 additions & 2 deletions pulpcore/app/replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ def remove_missing(self, names):
)

# Remove all the repositories and remotes of the missing distributions
repos_to_delete = self.repository_model_cls.objects.exclude(name__in=names)
repos_to_delete = self.repository_model_cls.objects.filter(pulp_domain=self.domain).exclude(name__in=names)
for repo in repos_to_delete:
dispatch(
general_delete,
task_group=self.task_group,
exclusive_resources=[repo],
args=(repo.pk, self.app_label, self.repository_serializer_name),
)
remotes_to_delete = self.remote_model_cls.objects.exclude(name__in=names)
remotes_to_delete = self.remote_model_cls.objects.filter(pulp_domain=self.domain).exclude(name__in=names)
for remote in remotes_to_delete:
dispatch(
general_delete,
Expand Down

0 comments on commit f9a2e1a

Please sign in to comment.