Project

General

Profile

« Previous | Next » 

Revision ddfc4136

Added by Partha Aji over 8 years ago

Fixes #13284 - Enables Taskgroups for Applicablity

The regenerate applicable errata call for a repository can return
either a Task Group or a list of spawned tasks. This commit enables
the use of that.
This is an important change in pulp 2.8.
Look at
https://github.com/pulp/pulp/blob/master/docs/dev-guide/integration/rest-api/consumer/applicability.rst#generate-content-applicability-for-updated-repositories
for more info.

View differences:

test/support/repository_support.rb
@schedule_resource = TestRuncible.server.resources.repository_schedule
@repo_extension = TestRuncible.server.extensions.repository
@task_resource = TestRuncible.server.resources.task
@task_group = TestRuncible.server.resources.task_group
@schedule_time = '2012-09-25T20:44:00Z/P7D'
@repo_type = type
@importer_type = "#{@repo_type}_importer"
......
wait_on_tasks(response['spawned_tasks'].map { |task_ref| {'task_id' => task_ref['task_id']} })
end
def wait_on_task_group(response)
until @task_group.completed?(@task_group.summary(response["group_id"]))
self.sleep_if_needed
end
@task_group.summary(response["group_id"])
end
def wait_on_tasks(tasks)
tasks.map do |task|
self.wait_on_task(task)

Also available in: Unified diff