mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 03:38:12 +08:00
fix cases where dict views could not be used in place of lists
This commit is contained in:
@@ -36,6 +36,8 @@ import tempfile
|
||||
import time
|
||||
from io import open
|
||||
from collections import defaultdict
|
||||
from itertools import chain
|
||||
|
||||
import kobo.rpmlib
|
||||
|
||||
from six import text_type
|
||||
@@ -276,7 +278,7 @@ class KojiContentGenerator(object):
|
||||
# Handle the multicall result. For each build associated with the source RPM,
|
||||
# store the exclusivearch and excludearch lists. For each RPM, store the 'license' and
|
||||
# also other useful data from the Build associated with the RPM.
|
||||
for rpm, headers in zip(src_rpms.values() + binary_rpms.values(), rpms_headers):
|
||||
for rpm, headers in zip(chain(src_rpms.values(), binary_rpms.values()), rpms_headers):
|
||||
if not headers:
|
||||
raise RuntimeError(
|
||||
"No RPM headers received from Koji for RPM %s" % rpm["name"])
|
||||
|
||||
@@ -632,7 +632,7 @@ def reuse_shared_userspace_init_data():
|
||||
|
||||
session.add(build_one)
|
||||
|
||||
components = mmd.get_rpm_components().values()
|
||||
components = list(mmd.get_rpm_components().values())
|
||||
components.sort(key=lambda x: x.get_buildorder())
|
||||
previous_buildorder = None
|
||||
batch = 1
|
||||
@@ -683,7 +683,7 @@ def reuse_shared_userspace_init_data():
|
||||
|
||||
session.add(build_one)
|
||||
|
||||
components2 = mmd2.get_rpm_components().values()
|
||||
components2 = list(mmd2.get_rpm_components().values())
|
||||
# Store components to database in different order than for 570 to
|
||||
# reproduce the reusing issue.
|
||||
components2.sort(key=lambda x: len(x.get_name()))
|
||||
|
||||
@@ -368,8 +368,8 @@ class TestUtils:
|
||||
mmd_pkg_refs = [pkg.get_ref() for pkg in mmd.get_rpm_components().values()]
|
||||
assert set(mmd_pkg_refs) == set(hashes_returned.keys())
|
||||
br = mmd.get_dependencies()[0].get_buildrequires()
|
||||
assert br.keys() == ['platform']
|
||||
assert br.values()[0].get() == ['f28']
|
||||
assert list(br.keys()) == ['platform']
|
||||
assert list(br.values())[0].get() == ['f28']
|
||||
xmd = {
|
||||
'mbs': {
|
||||
'commit': '',
|
||||
|
||||
Reference in New Issue
Block a user