mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-03 13:11:58 +08:00
Fix RuntimeError in owner-sync-pagure.j2
This is a small follow up fix related to 01be34a706.
Previously the script modified a list while iterating through it, which
is always a bad idea, but it didn't throw an error. My last changes
switched it to iterating through a list, which surfaced the flaw as a
RuntimeError. Using a set comprehension is a cleaner way to generate
the set we need to return.
Signed-off-by: Carl George <carlwgeorge@gmail.com>
This commit is contained in:
@@ -175,11 +175,11 @@ def get_project_name_and_its_active_branches(session, namespace, active_branches
|
||||
print('- Querying pagure distgit for package branches')
|
||||
project_branches = get_project_branches(session, namespace, project_name)
|
||||
try:
|
||||
active_package_branches = active_branches & project_branches
|
||||
for branch in active_package_branches:
|
||||
if branch in lookaside:
|
||||
if project_name in lookaside[branch]:
|
||||
active_package_branches.remove(branch)
|
||||
active_package_branches = {
|
||||
branch
|
||||
for branch in active_branches & project_branches
|
||||
if not (branch in lookaside and project_name in lookaside[branch])
|
||||
}
|
||||
|
||||
return project_name, active_package_branches
|
||||
|
||||
|
||||
Reference in New Issue
Block a user