diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-02-07 11:09:00 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-02-07 11:09:00 +0000 |
commit | cc7ac2b0820222053e15c953e8e02c7bbff1ad4d (patch) | |
tree | 250557ebe03ddc202823ba93a4148a519874c186 | |
parent | e50d00fe20126c05c96d77bfadcf99ef3f58acf5 (diff) | |
download | morph-cc7ac2b0820222053e15c953e8e02c7bbff1ad4d.tar.gz |
Make configuration-extensions have a default value
This saves a check (and an indentation) in the deployment plugin,
making the code a tiny bit simpler.
Suggested-By: Sam Thursfield
-rw-r--r-- | morphlib/morph2.py | 3 | ||||
-rw-r--r-- | morphlib/plugins/deploy_plugin.py | 20 |
2 files changed, 11 insertions, 12 deletions
diff --git a/morphlib/morph2.py b/morphlib/morph2.py index 3a3ad679..6e24765e 100644 --- a/morphlib/morph2.py +++ b/morphlib/morph2.py @@ -49,7 +49,8 @@ class Morphology(object): ('strata', []), ('description', ''), ('arch', None), - ('system-kind', None) + ('system-kind', None), + ('configuration-extensions', []), ] } diff --git a/morphlib/plugins/deploy_plugin.py b/morphlib/plugins/deploy_plugin.py index e921b0af..fbc8f145 100644 --- a/morphlib/plugins/deploy_plugin.py +++ b/morphlib/plugins/deploy_plugin.py @@ -137,17 +137,15 @@ class DeployPlugin(cliapp.Plugin): # Run configuration extensions. self.app.status(msg='Configure system') - m = artifact.source.morphology - if 'configuration-extensions' in m: - names = m['configuration-extensions'] - for name in names: - self._run_extension( - branch_dir, - build_ref, - name, - '.configure', - [system_tree], - env) + names = artifact.source.morphology['configuration-extensions'] + for name in names: + self._run_extension( + branch_dir, + build_ref, + name, + '.configure', + [system_tree], + env) # Run write extension. self.app.status(msg='Writing to device') |