diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-06-20 12:49:28 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-06-20 12:52:07 +0000 |
commit | dbbaf636b5b169b508703e597eea0eaebe38c439 (patch) | |
tree | 0f79733dc44188c615d94862118cb73bca5594cd /morphlib/morphologyfactory.py | |
parent | f26ce8c21fa345f6a922aa33c4adb871163ea5aa (diff) | |
download | morph-dbbaf636b5b169b508703e597eea0eaebe38c439.tar.gz |
Fix warnings and test suite
Diffstat (limited to 'morphlib/morphologyfactory.py')
-rw-r--r-- | morphlib/morphologyfactory.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/morphlib/morphologyfactory.py b/morphlib/morphologyfactory.py index 5b68f1a8..7f5cd94a 100644 --- a/morphlib/morphologyfactory.py +++ b/morphlib/morphologyfactory.py @@ -116,20 +116,18 @@ class MorphologyFactory(object): 'supports the following architectures: %s' % (morphology['arch'], ', '.join(valid_archs))) - if not morphology['system-kind']: - raise morphlib.Error('No system-kind defined in system %s ' - '(it is a mandatory field)' % filename) - - if morphology['system-kind'] != 'rootfs-tarball': + kind = morphology['system-kind'] + if kind == 'rootfs-tarball': # pragma: no cover self._app.status( - msg='You are using a system-kind %(kind)s. ' - 'This is deprecated and untested functionality that will ' - 'be removed in a future version of Baserock. The only ' - 'supported system-kind is rootfs-tarball. ' - 'Please convert your system morphologies to ' - 'rootfs-tarball and use morph deploy to create ' - 'disk images.', - kind=morphology['system-kind']) + msg='WARNING: Obsolete field system-kind used in morphology ' + '(it is harmless, but should be removed)') + elif kind: + raise morphlib.Error( + 'System kind %s is not supported (anymore), ' + 'the whole system-kind field is deprecated. ' + 'Please remove system-kind from your system ' + 'morphologies and morph deploy to create ' + 'the desired output format.' % kind) name = morphology['name'] morphology.builds_artifacts = [name + '-rootfs'] |