From e9f566f15dc390a008e6bd6d6d1c3abf362c2eb0 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Wed, 8 Jan 2025 14:30:41 +0100 Subject: [PATCH] backend: fix createrepo action for Pulp CoprDirs This method is called when backend receives a createrepo action. As you can see, the `dirname` parameter was unused. Which worked fine when the createrepo action was generated when creating a new project or when manually clicking the "Regenerate" button in a project overview. However, createrepo action is also emitted when somebody submits a build into a CoprDir and thereby creates it. --- backend/copr_backend/storage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/copr_backend/storage.py b/backend/copr_backend/storage.py index 65a59fcad..5b0a880a3 100644 --- a/backend/copr_backend/storage.py +++ b/backend/copr_backend/storage.py @@ -195,7 +195,7 @@ def __init__(self, *args, **kwargs): self.client = PulpClient.create_from_config_file() def init_project(self, dirname, chroot): - repository = self._repository_name(chroot) + repository = self._repository_name(chroot, dirname) response = self.client.create_repository(repository) if not response.ok and "This field must be unique" not in response.text: self.log.error("Failed to create a Pulp repository %s because of %s", @@ -206,7 +206,7 @@ def init_project(self, dirname, chroot): # mentioned by its href, not name repository = self._get_repository(chroot) - distribution = self._distribution_name(chroot) + distribution = self._distribution_name(chroot, dirname) response = self.client.create_distribution(distribution, repository) if not response.ok and "This field must be unique" not in response.text: self.log.error("Failed to create a Pulp distribution %s because of %s",