Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Fix schema for the reset/ endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
goosemania committed Feb 6, 2021
1 parent 1e98eef commit 86af5f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES/8211.bugfix
@@ -0,0 +1 @@
Fixed openapi schema for reset/ endpoint. Bindings no longer require `plan` parameter.
2 changes: 1 addition & 1 deletion pulp_2to3_migration/app/viewsets.py
Expand Up @@ -112,7 +112,7 @@ def run(self, request, pk):
"plugins specified in the migration plan.",
responses={202: AsyncOperationResponseSerializer}
)
@action(detail=True, methods=('post',))
@action(detail=True, methods=('post',), serializer_class=None)
def reset(self, request, pk):
"""Reset Pulp 3 data for plugins specified in the migration plan."""
migration_plan = self.get_object()
Expand Down
8 changes: 4 additions & 4 deletions pulp_2to3_migration/tests/functional/test_file_reset.py
Expand Up @@ -70,7 +70,7 @@ def _run_migration(self, migration_plan):

def _reset_pulp3_data(self, migration_plan):
"""Run a reset task and wait for it to be complete."""
mp_run_response = self.migration_plans_api.reset(migration_plan.pulp_href, {})
mp_run_response = self.migration_plans_api.reset(migration_plan.pulp_href)
monitor_task(mp_run_response.task)

def test_reset_file_plugin(self):
Expand Down Expand Up @@ -172,9 +172,9 @@ def test_run_only_one_reset(self):
mp = self.migration_plans_api.create({'plan': FILE_SIMPLE_PLAN})

# run twice
mp_run_response = self.migration_plans_api.reset(mp.pulp_href, {})
mp_run_response = self.migration_plans_api.reset(mp.pulp_href)
with self.assertRaises(ApiException):
self.migration_plans_api.reset(mp.pulp_href, {})
self.migration_plans_api.reset(mp.pulp_href)

# make sure the first task is completed not to interfere with further tests
monitor_task(mp_run_response.task)
Expand All @@ -186,7 +186,7 @@ def test_no_reset_when_migration(self):
# run the migration plan and then immediately run reset without waiting
mp_run_response = self.migration_plans_api.run(mp.pulp_href, {})
with self.assertRaises(ApiException):
self.migration_plans_api.reset(mp.pulp_href, {})
self.migration_plans_api.reset(mp.pulp_href)

# make sure the first task is completed not to interfere with further tests
task = monitor_task(mp_run_response.task)
Expand Down

0 comments on commit 86af5f4

Please sign in to comment.