From fc35b41a0189eb8a43032247cbe7d3cfadf6ded1 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 10 Sep 2014 10:51:28 +0000 Subject: Remove Morphology.builds_artifacts This was used before the Artifact splitting code landed to determine which artifacts should be produced. --- morphlib/artifactresolver_tests.py | 7 ------- morphlib/cachekeycomputer_tests.py | 6 ------ morphlib/morphologyfactory.py | 9 --------- morphlib/morphologyfactory_tests.py | 18 ------------------ morphlib/plugins/cross-bootstrap_plugin.py | 4 ---- 5 files changed, 44 deletions(-) (limited to 'morphlib') diff --git a/morphlib/artifactresolver_tests.py b/morphlib/artifactresolver_tests.py index 2051cbfd..15d5d6c4 100644 --- a/morphlib/artifactresolver_tests.py +++ b/morphlib/artifactresolver_tests.py @@ -33,15 +33,12 @@ def get_chunk_morphology(name, artifact_names=[]): text = yaml.dump({"name": name, "kind": "chunk", "products": artifacts}, default_flow_style=False) - builds_artifacts = artifact_names else: text = yaml.dump({'name': name, 'kind': 'chunk'}, default_flow_style=False) - builds_artifacts = [name] loader = morphlib.morphloader.MorphologyLoader() morph = loader.load_from_string(text) - morph.builds_artifacts = builds_artifacts return morph def get_stratum_morphology(name, chunks=[], build_depends=[]): @@ -75,7 +72,6 @@ def get_stratum_morphology(name, chunks=[], build_depends=[]): loader = morphlib.morphloader.MorphologyLoader() morph = loader.load_from_string(text) - morph.builds_artifacts = [name] return morph @@ -242,7 +238,6 @@ class ArtifactResolverTests(unittest.TestCase): - morph: stratum1 - morph: stratum2 ''') - morph.builds_artifacts = ['system-rootfs'] system = morphlib.source.Source( 'repo', 'ref', 'sha1', 'tree', morph, 'system.morph') pool.add(system) @@ -334,7 +329,6 @@ class ArtifactResolverTests(unittest.TestCase): - chunk1 - chunk2 ''') - morph.builds_artifacts = ['stratum'] stratum = morphlib.source.Source( 'repo', 'original/ref', 'sha1', 'tree', morph, 'stratum.morph') pool.add(stratum) @@ -439,7 +433,6 @@ class ArtifactResolverTests(unittest.TestCase): ref: original/ref build-depends: [] ''') - morph.builds_artifacts = ['stratum'] stratum = morphlib.source.Source( 'repo', 'original/ref', 'sha1', 'tree', morph, 'stratum.morph') pool.add(stratum) diff --git a/morphlib/cachekeycomputer_tests.py b/morphlib/cachekeycomputer_tests.py index 8558db6d..441f6123 100644 --- a/morphlib/cachekeycomputer_tests.py +++ b/morphlib/cachekeycomputer_tests.py @@ -89,12 +89,6 @@ class CacheKeyComputerTests(unittest.TestCase): self.source_pool.add(source) # FIXME: This should use MorphologyFactory m = source.morphology - if m['kind'] == 'system': - m.builds_artifacts = [m['name'] + '-rootfs'] - elif m['kind'] == 'stratum': - m.builds_artifacts = [m['name']] - elif m['kind'] == 'chunk': - m.builds_artifacts = [m['name']] self.build_env = DummyBuildEnvironment({ "LOGNAME": "foouser", "MORPH_ARCH": "dummy", diff --git a/morphlib/morphologyfactory.py b/morphlib/morphologyfactory.py index 1a8e374e..a576835e 100644 --- a/morphlib/morphologyfactory.py +++ b/morphlib/morphologyfactory.py @@ -103,23 +103,14 @@ class MorphologyFactory(object): '''Check and tweak a system morphology.''' name = morphology['name'] - morphology.builds_artifacts = [name + '-rootfs'] - morphology.needs_artifact_metadata_cached = False def _check_and_tweak_stratum(self, morphology, reponame, sha1, filename): '''Check and tweak a stratum morphology.''' - morphology.builds_artifacts = [morphology['name']] morphology.needs_artifact_metadata_cached = True def _check_and_tweak_chunk(self, morphology, reponame, sha1, filename): '''Check and tweak a chunk morphology.''' - if 'products' in morphology and len(morphology['products']) > 1: - morphology.builds_artifacts = [d['artifact'] - for d in morphology['products']] - else: - morphology.builds_artifacts = [morphology['name']] - morphology.needs_artifact_metadata_cached = False diff --git a/morphlib/morphologyfactory_tests.py b/morphlib/morphologyfactory_tests.py index 0b3253da..5692c5f0 100644 --- a/morphlib/morphologyfactory_tests.py +++ b/morphlib/morphologyfactory_tests.py @@ -248,24 +248,6 @@ class MorphologyFactoryTests(unittest.TestCase): self.assertRaises(NotcachedError, self.lmf.get_morphology, 'reponame', 'sha1', 'unreached.morph') - def test_sets_builds_artifacts_for_simple_chunk(self): - morph = self.mf.get_morphology('reponame', 'sha1', 'chunk.morph') - self.assertEqual(morph.builds_artifacts, ['chunk']) - - def test_sets_builds_artifacts_for_split_chunk(self): - morph = self.mf.get_morphology('reponame', 'sha1', 'chunk-split.morph') - self.assertEqual(morph.builds_artifacts, - ['chunk-split-runtime', 'chunk-split-devel']) - - def test_sets_builds_artifacts_for_stratum(self): - morph = self.mf.get_morphology('reponame', 'sha1', 'stratum.morph') - self.assertEqual(morph.builds_artifacts, ['stratum']) - - def test_sets_build_artifacts_for_system(self): - self.lr.arch = 'x86_32' - morph = self.mf.get_morphology('reponame', 'sha1', 'system.morph') - self.assertEqual(morph.builds_artifacts, ['system-rootfs']) - def test_does_not_set_needs_artifact_metadata_cached_for_chunk(self): morph = self.mf.get_morphology('reponame', 'sha1', 'chunk.morph') self.assertEqual(morph.needs_artifact_metadata_cached, False) diff --git a/morphlib/plugins/cross-bootstrap_plugin.py b/morphlib/plugins/cross-bootstrap_plugin.py index 26637bd1..95e991f4 100644 --- a/morphlib/plugins/cross-bootstrap_plugin.py +++ b/morphlib/plugins/cross-bootstrap_plugin.py @@ -261,12 +261,8 @@ class CrossBootstrapPlugin(cliapp.Plugin): build_command = morphlib.buildcommand.BuildCommand(self.app, build_env) morph_name = morphlib.util.sanitise_morphology_path(system_name) - builds_artifacts = [system_name + '-bootstrap-rootfs'] srcpool = build_command.create_source_pool(root_repo, ref, morph_name) - system_source = srcpool.lookup(root_repo, ref, morph_name) - system_source.morphology.builds_artifacts = builds_artifacts - # FIXME: this is a quick fix in order to get it working for # Baserock 13 release, it is not a reasonable fix def validate(self, root_artifact): -- cgit v1.2.1