diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-03-12 11:33:57 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-03-12 11:33:57 +0000 |
commit | ff473bab72a3a42ceee228b739577a153a3840de (patch) | |
tree | 1821f9a20665523ee5f33316498fd11999ad37c8 /morphlib | |
parent | 0ad170ce2d5ea81c4aceab16aca27d7f2f3c6e8d (diff) | |
download | morph-ff473bab72a3a42ceee228b739577a153a3840de.tar.gz |
Give a useful error when attempting to build a cluster morph
Previously this resulted in a confusing traceback.
This is a quick fix. I'd rather insert the error in the buildcommand
module instead, but that code assumes the source being built is a
system in several places before it actually checks the kind. Those
would all need to be changed, or the code would need to reworked to
call _validate_root_kind() much earlier.
The Application.traverse_morphs() method is rather ugly anyway, so I'm
happy to add further ugliness to it for the time being.
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/app.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index 9ceca9a8..409e0a12 100644 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -359,7 +359,10 @@ class Morph(cliapp.Application): morphology = resolved_morphologies[reference] visit(reponame, ref, filename, absref, tree, morphology) - if morphology['kind'] == 'system': + if morphology['kind'] == 'cluster': + raise cliapp.AppException( + "Cannot build a morphology of type 'cluster'.") + elif morphology['kind'] == 'system': queue.extend((s.get('repo') or reponame, s.get('ref') or ref, '%s.morph' % s['morph']) |