diff --git a/pulp_python/app/management/commands/repair-python-metadata.py b/pulp_python/app/management/commands/repair-python-metadata.py index ed4dec85..739d115b 100644 --- a/pulp_python/app/management/commands/repair-python-metadata.py +++ b/pulp_python/app/management/commands/repair-python-metadata.py @@ -59,7 +59,7 @@ def href_prn_list_handler(value): """Common list parsing for a string of hrefs/prns.""" r = re.compile( rf""" - (?:{settings.API_ROOT}(?:[-_a-zA-Z0-9]+/)?api/v3/repositories/python/python/[-a-f0-9]+/) + (?:{settings.API_ROOT}(?:[-_a-zA-Z0-9]+/)?api/v\d+/repositories/python/python/[-a-f0-9]+/) |(?:prn:python\.pythonrepository:[-a-f0-9]+) """, re.VERBOSE, diff --git a/pulp_python/app/viewsets.py b/pulp_python/app/viewsets.py index 30ce28a0..02fd1f0b 100644 --- a/pulp_python/app/viewsets.py +++ b/pulp_python/app/viewsets.py @@ -144,7 +144,7 @@ class PythonRepositoryViewSet( responses={202: AsyncOperationResponseSerializer}, ) @action(detail=True, methods=["post"], serializer_class=RepositoryAddRemoveContentSerializer) - def modify(self, request, pk): + def modify(self, request, pk, **kwargs): """ Queues a task that creates a new RepositoryVersion by adding and removing content units. @@ -196,7 +196,7 @@ def _early_blocklist_check(self, repository, content_ids): responses={202: AsyncOperationResponseSerializer}, ) @action(detail=True, methods=["post"], serializer_class=None) - def repair_metadata(self, request, pk): + def repair_metadata(self, request, pk, **kwargs): """ Trigger an asynchronous task to repair Python metadata. This task will repair metadata of all packages for the specified `Repository`, without creating a new `RepositoryVersion`. @@ -212,7 +212,7 @@ def repair_metadata(self, request, pk): @extend_schema(summary="Sync from remote", responses={202: AsyncOperationResponseSerializer}) @action(detail=True, methods=["post"], serializer_class=RepositorySyncURLSerializer) - def sync(self, request, pk): + def sync(self, request, pk, **kwargs): """ Trigger an asynchronous task to sync python content. The sync task will retrieve Python @@ -576,7 +576,7 @@ class PythonPackageSingleArtifactContentUploadViewSet( methods=["post"], serializer_class=python_serializers.PythonPackageContentUploadSerializer, ) - def upload(self, request): + def upload(self, request, **kwargs): """ Create a Python package. """ @@ -748,7 +748,7 @@ class PythonRemoteViewSet(core_viewsets.RemoteViewSet, core_viewsets.RolesMixin) methods=["post"], serializer_class=python_serializers.PythonBanderRemoteSerializer, ) - def from_bandersnatch(self, request): + def from_bandersnatch(self, request, **kwargs): """ Takes the fields specified in the Bandersnatch config and creates a Python Remote from it. @@ -875,7 +875,7 @@ class PythonPublicationViewSet(core_viewsets.PublicationViewSet, core_viewsets.R } @extend_schema(responses={202: AsyncOperationResponseSerializer}, deprecated=True) - def create(self, request): + def create(self, request, **kwargs): """ Dispatches a publish task, which generates metadata that will be used by pip. diff --git a/pulp_python/tests/functional/api/test_domains.py b/pulp_python/tests/functional/api/test_domains.py index 50bec9ca..391af15c 100644 --- a/pulp_python/tests/functional/api/test_domains.py +++ b/pulp_python/tests/functional/api/test_domains.py @@ -29,7 +29,7 @@ def test_domain_object_creation( domain_name = domain.name repo = python_repo_factory(pulp_domain=domain_name) - assert f"{domain_name}/api/v3/" in repo.pulp_href + assert f"{domain_name}/api/" in repo.pulp_href repos = python_bindings.RepositoriesPythonApi.list(pulp_domain=domain_name) assert repos.count == 1