Story #4331
closedAs a task writer, I can lock on an arbitrary string
100%
Description
Currently, the tasking system only lets you lock on individual resources or a list of resources[0] which it then converts to urls[1]. However, it needs to be able to also accept a string or list of strings.
An example use case is where we need to lock on all distributions (present and future), in which case we would lock on "/pulp/api/v3/distributions/" or something similar.
[0] https://github.com/pulp/pulp/blob/331e58741fdb94d28582ae8b3f4c5a13a6bd6d55/pulpcore/tasking/tasks.py#L147
[1] https://github.com/pulp/pulp/blob/331e58741fdb94d28582ae8b3f4c5a13a6bd6d55/pulpcore/tasking/tasks.py#L180
Related issues
Updated by daviddavis almost 6 years ago
- Blocks Story #3044: Distribution create/update operations should be asynchronous added
Updated by bmbouter almost 6 years ago
Currently the resources
argument is a list. What if we allowed resources
to instead accept various types and enqueue_with_reservation
was more capable about coercing one or many resources or strings to a list of strings? Here a code example:
If not isinstance(resources, list): # listify it
resources = [resources]
for i, resource in enumerate(resources):
if isinstance(resource, str):
continue
resources[i] = util.get_url(resource)
Updated by jortel@redhat.com almost 6 years ago
bmbouter wrote:
Currently the
resources
argument is a list. What if we allowedresources
to instead accept various types andenqueue_with_reservation
was more capable about coercing one or many resources or strings to a list of strings?
Seems reasonable.
Updated by CodeHeeler almost 6 years ago
- Tracker changed from Issue to Story
- % Done set to 0
Updated by jortel@redhat.com almost 6 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to jortel@redhat.com
Updated by jortel@redhat.com almost 6 years ago
- Status changed from ASSIGNED to POST
Added by jortel@redhat.com almost 6 years ago
Added by jortel@redhat.com almost 6 years ago
Revision 602e69a0 | View on GitHub
Support resource URLs in enqueue_with_reservation(). closes #4331
Updated by jortel@redhat.com almost 6 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|602e69a0fa153094fc61eac2fd55aa943d2ab942.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Support resource URLs in enqueue_with_reservation(). closes #4331