Project

Profile

Help

Story #4331

As a task writer, I can lock on an arbitrary string

Added by daviddavis 9 months ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Platform Release:
Blocks Release:
Backwards Incompatible:
No
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

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.

[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

Blocks Pulp - Story #3044: Distribution create/update operations should be asynchronous MODIFIED Actions

Associated revisions

Revision 602e69a0 View on GitHub
Added by jortel@redhat.com 9 months ago

Support resource URLs in enqueue_with_reservation().
closes #4331

Revision 602e69a0 View on GitHub
Added by jortel@redhat.com 9 months ago

Support resource URLs in enqueue_with_reservation().
closes #4331

History

#1 Updated by daviddavis 9 months ago

  • Blocks Story #3044: Distribution create/update operations should be asynchronous added

#2 Updated by bmbouter 9 months 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)

#3 Updated by jortel@redhat.com 9 months ago

bmbouter wrote:

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?

Seems reasonable.

#4 Updated by daviddavis 9 months ago

+1 from me

#5 Updated by CodeHeeler 9 months ago

  • Tracker changed from Issue to Story
  • % Done set to 0

#6 Updated by jortel@redhat.com 9 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to jortel@redhat.com

#7 Updated by jortel@redhat.com 9 months ago

  • Status changed from ASSIGNED to POST

#8 Updated by jortel@redhat.com 9 months ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#9 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#10 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3, Pulp 3 RC Blocker)

Please register to edit this issue

Also available in: Atom PDF