summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2014-07-18 16:10:22 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2014-07-22 15:55:26 +0100
commitabb93656aa0b8de1e086c8f142bf468d3b50f26e (patch)
tree984a0f1acc37768f5206f8b3be0c78aec2cfda3e
parent11926f251856e48955c986de9653cdfb829d1c0f (diff)
downloadmorph-abb93656aa0b8de1e086c8f142bf468d3b50f26e.tar.gz
Don't set 'morph' field by default, and don't expect to find it
-rw-r--r--morphlib/artifactresolver.py4
-rw-r--r--morphlib/buildcommand.py3
-rw-r--r--morphlib/morph2.py4
-rw-r--r--morphlib/morph2_tests.py1
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 83971bb8..b49c0f73 100644
--- a/morphlib/morph2.py
+++ b/morphlib/morph2.py
@@ -191,8 +191,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:
@@ -226,7 +224,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):