Skip to content

Commit

Permalink
backend: fix createrepo action for Pulp CoprDirs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
FrostyX authored and praiskup committed Jan 9, 2025
1 parent 88293f0 commit e9f566f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/copr_backend/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit e9f566f

Please sign in to comment.