Stop storing modulemd without arch
Historically each variant had a list of modules. This is no longer needed and can be dropped. We can also stop logging the modulemd since we know it was retrieved from Koji and not modified locally. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
a31fe998d5
commit
04baa2a4db
@ -249,7 +249,6 @@ def _add_module_to_variant(koji_wrapper, variant, build, add_to_variant_modules=
|
||||
source_mmd.set_name(build["extra"]["typeinfo"]["module"]["name"])
|
||||
nsvc = source_mmd.dup_nsvc()
|
||||
|
||||
variant.mmds.append(source_mmd)
|
||||
for arch in variant.arches:
|
||||
try:
|
||||
variant.arch_mmds.setdefault(arch, {})[nsvc] = mmds["modulemd.%s.txt" % arch]
|
||||
@ -564,9 +563,6 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event):
|
||||
"modules.")
|
||||
|
||||
if modular_koji_tags or (compose.conf["pkgset_koji_module_tag"] and variant.modules):
|
||||
included_modules_file = os.path.join(
|
||||
compose.paths.work.topdir(arch="global"),
|
||||
"koji-tag-module-%s.yaml" % variant.uid)
|
||||
_get_modules_from_koji_tags(
|
||||
compose,
|
||||
koji_wrapper,
|
||||
@ -575,9 +571,6 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event):
|
||||
variant_tags,
|
||||
)
|
||||
elif variant.modules:
|
||||
included_modules_file = os.path.join(
|
||||
compose.paths.work.topdir(arch="global"),
|
||||
"koji-module-%s.yaml" % variant.uid)
|
||||
_get_modules_from_koji(
|
||||
compose,
|
||||
koji_wrapper,
|
||||
@ -592,8 +585,6 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event):
|
||||
if variant_tag not in compose_tags:
|
||||
compose_tags.append(variant_tag)
|
||||
|
||||
if variant.mmds:
|
||||
Modulemd.Module.dump_all(variant.mmds, included_modules_file)
|
||||
if not variant_tags[variant] and variant.modules is None:
|
||||
variant_tags[variant].extend(force_list(compose.conf["pkgset_koji_tag"]))
|
||||
|
||||
|
@ -264,7 +264,6 @@ class Variant(object):
|
||||
self.is_empty = is_empty
|
||||
|
||||
self.pkgset = None
|
||||
self.mmds = []
|
||||
self.arch_mmds = {}
|
||||
self.module_uid_to_koji_tag = {}
|
||||
self.nsvc_to_pkgset = {}
|
||||
|
@ -60,7 +60,6 @@ class MockVariant(mock.Mock):
|
||||
def __init__(self, is_empty=False, name=None, *args, **kwargs):
|
||||
super(MockVariant, self).__init__(*args, is_empty=is_empty, **kwargs)
|
||||
self.parent = kwargs.get('parent', None)
|
||||
self.mmds = []
|
||||
self.arch_mmds = {}
|
||||
self.module_uid_to_koji_tag = {}
|
||||
self.variants = {}
|
||||
@ -114,7 +113,6 @@ class MockVariant(mock.Mock):
|
||||
if self.modules is None:
|
||||
self.modules = []
|
||||
self.modules.append(":".join([name, stream, version]))
|
||||
self.mmds.append(mmd)
|
||||
if mmd_arch:
|
||||
self.arch_mmds.setdefault(mmd_arch, {})[mmd.dup_nsvc()] = mmd
|
||||
return mmd
|
||||
|
@ -741,7 +741,6 @@ class TestCreateVariantRepo(PungiTestCase):
|
||||
"test:f27:1:2017", rpm_nvrs=["pkg-0:1.0.0-1.x86_64"])
|
||||
variant.arch_mmds["x86_64"]["test:f28:1:2017"] = variant.add_fake_module(
|
||||
"test:f28:1:2017", rpm_nvrs=["pkg-0:2.0.0-1.x86_64"])
|
||||
variant.mmds = list(variant.arch_mmds["x86_64"].values())
|
||||
|
||||
def mocked_modifyrepo_cmd(repodir, mmd_path, **kwargs):
|
||||
modules = Modulemd.Module.new_all_from_file(mmd_path)
|
||||
@ -792,7 +791,6 @@ class TestCreateVariantRepo(PungiTestCase):
|
||||
with_artifacts=True,
|
||||
),
|
||||
}
|
||||
variant.mmds = list(variant.arch_mmds["x86_64"].values())
|
||||
variant.module_uid_to_koji_tag = {
|
||||
"test:f28:2018:beef": "tag-1",
|
||||
"test:f27:2018:cafe": "tag-2",
|
||||
|
@ -315,14 +315,6 @@ class TestRunSolver(HelperMixin, helpers.PungiTestCase):
|
||||
peek_context=mock.Mock(return_value="ctx"),
|
||||
)
|
||||
}
|
||||
self.compose.variants["Server"].mmds = [
|
||||
mock.Mock(
|
||||
peek_name=mock.Mock(return_value="mod"),
|
||||
peek_stream=mock.Mock(return_value="master"),
|
||||
peek_version=mock.Mock(return_value="ver"),
|
||||
peek_context=mock.Mock(return_value="ctx"),
|
||||
)
|
||||
]
|
||||
po.return_value = ([], ["m1"])
|
||||
|
||||
res = self.phase.run_solver(
|
||||
|
@ -706,12 +706,11 @@ class TestAddModuleToVariant(unittest.TestCase):
|
||||
def test_adding_module(self):
|
||||
build = {"id": 1234, "extra": {"typeinfo": {"module": {"name": "module"}}}}
|
||||
variant = mock.Mock(
|
||||
arches=["armhfp", "x86_64"], mmds=[], arch_mmds={}, modules=[]
|
||||
arches=["armhfp", "x86_64"], arch_mmds={}, modules=[]
|
||||
)
|
||||
|
||||
source_koji._add_module_to_variant(self.koji, variant, build)
|
||||
|
||||
self.assertEqual(variant.mmds, [MockModule("/koji/modulemd.txt")])
|
||||
self.assertEqual(
|
||||
variant.arch_mmds,
|
||||
{
|
||||
@ -729,7 +728,6 @@ class TestAddModuleToVariant(unittest.TestCase):
|
||||
build = {"id": 1234, "extra": {"typeinfo": {"module": {"name": "module"}}}}
|
||||
variant = mock.Mock(
|
||||
arches=["armhfp", "x86_64"],
|
||||
mmds=[MockModule("/koji/m1.txt")],
|
||||
arch_mmds={
|
||||
"x86_64": {"m1:latest:20190101.cafe": MockModule("/koji/m1.x86_64.txt")}
|
||||
},
|
||||
@ -738,9 +736,6 @@ class TestAddModuleToVariant(unittest.TestCase):
|
||||
|
||||
source_koji._add_module_to_variant(self.koji, variant, build)
|
||||
|
||||
self.assertEqual(
|
||||
variant.mmds, [MockModule("/koji/m1.txt"), MockModule("/koji/modulemd.txt")]
|
||||
)
|
||||
self.assertEqual(
|
||||
variant.arch_mmds,
|
||||
{
|
||||
@ -758,14 +753,13 @@ class TestAddModuleToVariant(unittest.TestCase):
|
||||
def test_adding_module_with_add_module(self):
|
||||
build = {"id": 1234, "extra": {"typeinfo": {"module": {"name": "module"}}}}
|
||||
variant = mock.Mock(
|
||||
arches=["armhfp", "x86_64"], mmds=[], arch_mmds={}, modules=[]
|
||||
arches=["armhfp", "x86_64"], arch_mmds={}, modules=[]
|
||||
)
|
||||
|
||||
source_koji._add_module_to_variant(
|
||||
self.koji, variant, build, add_to_variant_modules=True
|
||||
)
|
||||
|
||||
self.assertEqual(variant.mmds, [MockModule("/koji/modulemd.txt")])
|
||||
self.assertEqual(
|
||||
variant.arch_mmds,
|
||||
{
|
||||
@ -783,7 +777,6 @@ class TestAddModuleToVariant(unittest.TestCase):
|
||||
build = {"id": 1234, "extra": {"typeinfo": {"module": {"name": "module"}}}}
|
||||
variant = mock.Mock(
|
||||
arches=["armhfp", "x86_64"],
|
||||
mmds=[MockModule("/koji/m1.txt")],
|
||||
arch_mmds={
|
||||
"x86_64": {"m1:latest:20190101.cafe": MockModule("/koji/m1.x86_64.txt")}
|
||||
},
|
||||
@ -794,9 +787,6 @@ class TestAddModuleToVariant(unittest.TestCase):
|
||||
self.koji, variant, build, add_to_variant_modules=True
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
variant.mmds, [MockModule("/koji/m1.txt"), MockModule("/koji/modulemd.txt")]
|
||||
)
|
||||
self.assertEqual(
|
||||
variant.arch_mmds,
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user