Task #2273
closedMove OperationPostponed middleware to somewhere in pulp.app and update
100%
Description
Currently the middleware lives at https://github.com/pulp/pulp/blob/master/server/pulp/server/webservices/middleware/postponed.py
- This needs to be moved to somewhere in pulp.app Maybe as pulp.app.middleware.postponed ?
- Included in the new Django settings file (pulp.app.settings) so that Django uses it
- Rethink or delete the OperationPostponed object.
- Test that the middleware works
Question¶
Do we want to continue using OperationPostponedException? It is convenient to raise it, but it is strange since that is how 100% of view calls will exit for most calls.
As an alternative we could have many views return an object type that the "postponed middleware" would use to know the task id. I believe each call dispatches exactly 1 task right? Once the middleware knows the task ID I think it could just return that UUID data in a structured, REST-y way.
Comparison to 2.y¶
I believe in 2.y we lookup the TaskStatus info and return it as part of an operation postponed. This would cause the return data for an OperationPostponed to be the UUID and a REST-y link to the detail view for that Task. This would require the user to make an additional call to lookup that task by UUID to get its details.
Adds OperationPostponedResponse object
This patch also removes the middleware that used to handle OperationPostponed exceptions.
closes #2273 https://pulp.plan.io/issues/2273