As a task writer, I can lock on an arbitrary string
Currently, the tasking system only lets you lock on individual resources or a list of resources0 which it then converts to urls1. 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.
#2 Updated by bmbouter about 1 year ago
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)
#3 Updated by firstname.lastname@example.org about 1 year ago
resourcesargument is a list. What if we allowed
resourcesto instead accept various types and
enqueue_with_reservationwas more capable about coercing one or many resources or strings to a list of strings?
Please register to edit this issue