|
11 | 11 | AsyncOperationResponseSerializer, |
12 | 12 | RepositorySyncURLSerializer, |
13 | 13 | ) |
14 | | -from pulpcore.plugin.tasking import enqueue_with_reservation |
| 14 | +from pulpcore.plugin.tasking import dispatch |
15 | 15 |
|
16 | 16 | from pulp_python.app import models as python_models |
17 | 17 | from pulp_python.app import serializers as python_serializers |
@@ -49,12 +49,12 @@ def sync(self, request, pk): |
49 | 49 | remote = serializer.validated_data.get('remote', repository.remote) |
50 | 50 | mirror = serializer.validated_data.get('mirror') |
51 | 51 |
|
52 | | - result = enqueue_with_reservation( |
| 52 | + result = dispatch( |
53 | 53 | tasks.sync, |
54 | 54 | [repository, remote], |
55 | 55 | kwargs={ |
56 | | - 'remote_pk': remote.pk, |
57 | | - 'repository_pk': repository.pk, |
| 56 | + 'remote_pk': str(remote.pk), |
| 57 | + 'repository_pk': str(repository.pk), |
58 | 58 | 'mirror': mirror |
59 | 59 | } |
60 | 60 | ) |
@@ -213,11 +213,11 @@ def create(self, request): |
213 | 213 | repository = serializer.validated_data.get('repository') |
214 | 214 | repository_version = RepositoryVersion.latest(repository) |
215 | 215 |
|
216 | | - result = enqueue_with_reservation( |
| 216 | + result = dispatch( |
217 | 217 | tasks.publish, |
218 | 218 | [repository_version.repository], |
219 | 219 | kwargs={ |
220 | | - 'repository_version_pk': repository_version.pk |
| 220 | + 'repository_version_pk': str(repository_version.pk) |
221 | 221 | } |
222 | 222 | ) |
223 | 223 | return core_viewsets.OperationPostponedResponse(result, request) |
0 commit comments