From e0ae421e8ab6fac4f1db669b45ba185e66f66505 Mon Sep 17 00:00:00 2001 From: Francisco Redondo Marchena Date: Tue, 5 Aug 2014 16:00:59 +0000 Subject: Add deploy-defaults before deploy in the MorphologyDumper keyorder --- morphlib/morphloader.py | 1 + 1 file changed, 1 insertion(+) (limited to 'morphlib/morphloader.py') diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py index 05dcb62c..c601a6b1 100644 --- a/morphlib/morphloader.py +++ b/morphlib/morphloader.py @@ -255,6 +255,7 @@ class MorphologyDumper(yaml.SafeDumper): 'artifact', 'include', 'systems', + 'deploy-defaults', 'deploy', 'type', 'location', -- cgit v1.2.1 From 461a195b9b3c12c5ebf7051b857196298ef7aaf7 Mon Sep 17 00:00:00 2001 From: Francisco Redondo Marchena Date: Mon, 11 Aug 2014 10:58:38 +0000 Subject: Add system-integration to chunk _static_defaults --- morphlib/morphloader.py | 1 + 1 file changed, 1 insertion(+) (limited to 'morphlib/morphloader.py') diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py index c601a6b1..d7cd602f 100644 --- a/morphlib/morphloader.py +++ b/morphlib/morphloader.py @@ -357,6 +357,7 @@ class MorphologyLoader(object): 'build-system': 'manual', 'build-mode': 'staging', 'prefix': '/usr', + 'system-integration': [], }, 'stratum': { 'chunks': [], -- cgit v1.2.1 From 88636270646afc9f197f89d00e4ff5740f681738 Mon Sep 17 00:00:00 2001 From: Francisco Redondo Marchena Date: Fri, 15 Aug 2014 10:08:33 +0000 Subject: Set chunk static default to None --- morphlib/morphloader.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'morphlib/morphloader.py') diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py index d7cd602f..78abd9fe 100644 --- a/morphlib/morphloader.py +++ b/morphlib/morphloader.py @@ -339,18 +339,18 @@ class MorphologyLoader(object): _static_defaults = { 'chunk': { 'description': '', - 'pre-configure-commands': [], - 'configure-commands': [], - 'post-configure-commands': [], - 'pre-build-commands': [], - 'build-commands': [], - 'post-build-commands': [], - 'pre-test-commands': [], - 'test-commands': [], - 'post-test-commands': [], - 'pre-install-commands': [], - 'install-commands': [], - 'post-install-commands': [], + 'pre-configure-commands': None, + 'configure-commands': None, + 'post-configure-commands': None, + 'pre-build-commands': None, + 'build-commands': None, + 'post-build-commands': None, + 'pre-test-commands': None, + 'test-commands': None, + 'post-test-commands': None, + 'pre-install-commands': None, + 'install-commands': None, + 'post-install-commands': None, 'devices': [], 'products': [], 'max-jobs': None, -- cgit v1.2.1 From dbc508a019a55b31bf4481225894aca8340747a2 Mon Sep 17 00:00:00 2001 From: Francisco Redondo Marchena Date: Fri, 15 Aug 2014 17:20:29 +0000 Subject: Fix morphloader to unset_defaults for chunks --- morphlib/morphloader.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'morphlib/morphloader.py') diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py index 78abd9fe..bc7ab6ef 100644 --- a/morphlib/morphloader.py +++ b/morphlib/morphloader.py @@ -692,8 +692,7 @@ class MorphologyLoader(object): if key in morphology and morphology[key] == defaults[key]: del morphology[key] - if kind in ('system', 'stratum', 'cluster'): - getattr(self, '_unset_%s_defaults' % kind)(morphology) + getattr(self, '_unset_%s_defaults' % kind)(morphology) @classmethod def _set_stratum_specs_defaults(cls, morphology, specs_field): @@ -757,6 +756,18 @@ class MorphologyLoader(object): if morph['max-jobs'] is not None: morph['max-jobs'] = int(morph['max-jobs']) + def _unset_chunk_defaults(self, morph): # pragma: no cover + for key in self._static_defaults['chunk']: + if key not in morph: continue + if 'commands' not in key: continue + attr = key.replace('-', '_') + default_bs = self._static_defaults['chunk']['build-system'] + bs = morphlib.buildsystem.lookup_build_system( + morph.get('build-system', default_bs)) + default_value = getattr(bs, attr) + if morph[key] == default_value: + del morph[key] + def set_commands(self, morph): if morph['kind'] == 'chunk': for key in self._static_defaults['chunk']: -- cgit v1.2.1