summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-17 15:26:02 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-18 18:29:25 +0100
commit214c3f223c889199ae783e1cab555c09fcd64b4d (patch)
tree106857729672748c26b38d8be4641013c1acd66d
parent469dde8a618c918b345745e885e0e7da5122e972 (diff)
downloadmorph-214c3f223c889199ae783e1cab555c09fcd64b4d.tar.gz
Have a default 'chunks' field in a chunk morphology
-rw-r--r--morphlib/artifactresolver.py2
-rw-r--r--morphlib/morph2.py1
-rw-r--r--morphlib/morph2_tests.py1
3 files changed, 3 insertions, 1 deletions
diff --git a/morphlib/artifactresolver.py b/morphlib/artifactresolver.py
index 25836b41..a458f52a 100644
--- a/morphlib/artifactresolver.py
+++ b/morphlib/artifactresolver.py
@@ -243,7 +243,7 @@ class ArtifactResolver(object):
return artifacts
def _chunk_artifact_names(self, source):
- if 'chunks' in source.morphology:
+ if len(source.morphology['chunks']) > 0:
return sorted(source.morphology['chunks'].keys())
else:
return [source.morphology['name']]
diff --git a/morphlib/morph2.py b/morphlib/morph2.py
index dbbf0c68..b5517f46 100644
--- a/morphlib/morph2.py
+++ b/morphlib/morph2.py
@@ -31,6 +31,7 @@ class Morphology(object):
('build-commands', []),
('test-commands', []),
('install-commands', []),
+ ('chunks', {}),
('sources', []),
('strata', []),
('max-jobs', None),
diff --git a/morphlib/morph2_tests.py b/morphlib/morph2_tests.py
index 65ab89cf..6cda67df 100644
--- a/morphlib/morph2_tests.py
+++ b/morphlib/morph2_tests.py
@@ -38,6 +38,7 @@ class MorphologyTests(unittest.TestCase):
self.assertEqual(m['test-commands'], [])
self.assertEqual(m['install-commands'], [])
self.assertEqual(m['max-jobs'], None)
+ self.assertEqual(m['chunks'], {})
def test_makes_max_jobs_be_an_integer(self):
m = Morphology('''