-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabled dispatching customization for collections
https://pulp.plan.io/issues/6673 closes #6673
- Loading branch information
Showing
5 changed files
with
36 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Enabled dispatching customization for importing collections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from pulpcore.plugin.tasking import enqueue_with_reservation | ||
|
||
from pulp_ansible.app.tasks.collections import import_collection | ||
|
||
|
||
class UploadGalaxyCollectionMixin: | ||
""" | ||
Provides a method that dispatches a task. | ||
""" | ||
|
||
def _dispatch_import_collection_task(self, artifact_pk, repository=None, **kwargs): | ||
""" | ||
Dispatch a Import Collection creation task. | ||
""" | ||
locks = [str(artifact_pk)] | ||
kwargs["artifact_pk"] = artifact_pk | ||
if repository: | ||
locks.append(repository) | ||
kwargs["repository_pk"] = repository.pk | ||
|
||
return enqueue_with_reservation(import_collection, locks, kwargs=kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters