diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-07-14 11:23:29 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-07-14 13:44:18 +0000 |
commit | 0731a00c37b84cfbc6a7215a4c2d7fd49f37d50f (patch) | |
tree | 67eb9c8962a0443c34864e5da02f9b3b9f7c5c89 | |
parent | cf3fc436a17761815716b466eca2598f513f03b3 (diff) | |
download | morph-0731a00c37b84cfbc6a7215a4c2d7fd49f37d50f.tar.gz |
Don't set 'morph' field by default, and don't expect to find it
-rw-r--r-- | morphlib/artifactresolver.py | 4 | ||||
-rw-r--r-- | morphlib/buildcommand.py | 3 | ||||
-rw-r--r-- | morphlib/morph2.py | 4 | ||||
-rw-r--r-- | morphlib/morph2_tests.py | 1 |
4 files changed, 6 insertions, 6 deletions
diff --git a/morphlib/artifactresolver.py b/morphlib/artifactresolver.py index c18042a3..9e3cea48 100644 --- a/morphlib/artifactresolver.py +++ b/morphlib/artifactresolver.py @@ -191,10 +191,12 @@ class ArtifactResolver(object): name_to_processed_artifacts = {} for info in source.morphology['chunks']: + filename = morphlib.util.sanitise_morphology_path( + info.get('morph', info['name'])) chunk_source = self._source_pool.lookup( info['repo'], info['ref'], - morphlib.util.sanitise_morphology_path(info['morph'])) + filename) chunk_name = chunk_source.morphology['name'] diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index 45c6ef00..4dea7b68 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -231,7 +231,8 @@ class BuildCommand(object): for spec in specs: repo_name = spec.get('repo') or src.repo_name ref = spec.get('ref') or src.original_ref - filename = morphlib.util.sanitise_morphology_path(spec['morph']) + filename = morphlib.util.sanitise_morphology_path( + spec.get('morph', spec.get('name'))) logging.debug( 'Validating cross ref to %s:%s:%s' % (repo_name, ref, filename)) diff --git a/morphlib/morph2.py b/morphlib/morph2.py index cc6ce926..de04a0db 100644 --- a/morphlib/morph2.py +++ b/morphlib/morph2.py @@ -190,8 +190,6 @@ class Morphology(object): for source in self['chunks']: if 'repo' not in source: self._set_default_value(source, 'repo', source['name']) - if 'morph' not in source: - self._set_default_value(source, 'morph', source['name']) if 'build-depends' not in source: self._set_default_value(source, 'build-depends', None) if 'build-mode' not in source: @@ -225,7 +223,7 @@ class Morphology(object): return info elif self['kind'] == 'stratum': for info in self['chunks']: - source_name = info.get('alias', info['morph']) + source_name = info.get('alias', info['name']) if source_name == name: return info raise KeyError('"%s" not found' % name) diff --git a/morphlib/morph2_tests.py b/morphlib/morph2_tests.py index d02aab1c..c9957ad5 100644 --- a/morphlib/morph2_tests.py +++ b/morphlib/morph2_tests.py @@ -95,7 +95,6 @@ class MorphologyTests(unittest.TestCase): ''') self.assertEqual(m['chunks'][0]['repo'], 'le-chunk') - self.assertEqual(m['chunks'][0]['morph'], 'le-chunk') self.assertEqual(m['chunks'][0]['build-depends'], None) def test_returns_dict_keys(self): |