summaryrefslogtreecommitdiff
path: root/morphlib/morphologyfactory.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-06-20 12:49:28 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-06-20 12:52:07 +0000
commitdbbaf636b5b169b508703e597eea0eaebe38c439 (patch)
tree0f79733dc44188c615d94862118cb73bca5594cd /morphlib/morphologyfactory.py
parentf26ce8c21fa345f6a922aa33c4adb871163ea5aa (diff)
downloadmorph-dbbaf636b5b169b508703e597eea0eaebe38c439.tar.gz
Fix warnings and test suite
Diffstat (limited to 'morphlib/morphologyfactory.py')
-rw-r--r--morphlib/morphologyfactory.py24
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']