diff --git a/CHANGES/plugin_api/+override-modify-task.feature b/CHANGES/plugin_api/+override-modify-task.feature new file mode 100644 index 00000000000..c643a4eb8bc --- /dev/null +++ b/CHANGES/plugin_api/+override-modify-task.feature @@ -0,0 +1,2 @@ +Added `modify_task` property to `ModifyRepositoryActionMixin` so plugin writers can override the +task that Pulp calls. diff --git a/pulpcore/plugin/actions.py b/pulpcore/plugin/actions.py index ce9d1c225b1..2a98d917895 100644 --- a/pulpcore/plugin/actions.py +++ b/pulpcore/plugin/actions.py @@ -15,6 +15,8 @@ class ModifyRepositoryActionMixin: + modify_task = tasks.repository.add_and_remove + @extend_schema( description="Trigger an asynchronous task to create a new repository version.", summary="Modify Repository Content", @@ -35,7 +37,7 @@ def modify(self, request, pk): base_version_pk = None task = dispatch( - tasks.repository.add_and_remove, + self.modify_task, exclusive_resources=[repository], kwargs={ "repository_pk": pk,