From 1249276b9de82fbb69a1aa1e9ac6b877ae7275fb Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sun, 4 Apr 2021 11:03:49 +0200 Subject: [PATCH 1/4] now we can personalise default setting for file et override --- doc/dev/config.md | 86 ++++++++++++------- doc/service/file.md | 8 +- doc/service/override.md | 2 + src/rougail/annotator/service.py | 37 ++++---- src/rougail/annotator/variable.py | 7 +- src/rougail/config.py | 7 +- src/rougail/data/rougail.dtd | 10 ++- src/rougail/template/base.py | 64 +++++++++++--- .../01base_file/makedict/after.json | 48 ----------- .../01base_file/makedict/base.json | 12 --- .../01base_file/makedict/before.json | 48 ----------- .../dictionaries/01base_file/tiramisu/base.py | 35 +++----- .../01base_file_include/makedict/after.json | 48 ----------- .../01base_file_include/makedict/base.json | 12 --- .../01base_file_include/makedict/before.json | 48 ----------- .../01base_file_include/tiramisu/base.py | 35 +++----- .../makedict/after.json | 72 ---------------- .../makedict/base.json | 18 ---- .../makedict/before.json | 72 ---------------- .../tiramisu/base.py | 47 ++++------ .../makedict/after.json | 72 ---------------- .../makedict/base.json | 18 ---- .../makedict/before.json | 72 ---------------- .../01base_file_include_name/tiramisu/base.py | 47 ++++------ .../01base_file_patch/makedict/after.json | 48 ----------- .../01base_file_patch/makedict/base.json | 12 --- .../01base_file_patch/makedict/before.json | 48 ----------- .../01base_file_patch/tiramisu/base.py | 35 +++----- .../01base_file_utfchar/makedict/after.json | 48 ----------- .../01base_file_utfchar/makedict/base.json | 12 --- .../01base_file_utfchar/makedict/before.json | 48 ----------- .../01base_file_utfchar/tiramisu/base.py | 35 +++----- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 48 ----------- .../makedict/base.json | 12 --- .../makedict/before.json | 48 ----------- .../tiramisu/base.py | 34 +++----- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../20notemplating/makedict/after.json | 24 ------ .../20notemplating/makedict/base.json | 6 -- .../20notemplating/makedict/before.json | 24 ------ .../20notemplating/tiramisu/base.py | 20 ++--- .../20override/makedict/after.json | 24 ------ .../20override/makedict/base.json | 6 -- .../20override/makedict/before.json | 24 ------ .../dictionaries/20override/tiramisu/base.py | 35 ++++---- .../makedict/after.json | 12 --- .../makedict/base.json | 3 - .../makedict/before.json | 12 --- .../20override_no_templating/tiramisu/base.py | 16 ++-- .../20override_source/makedict/after.json | 12 --- .../20override_source/makedict/base.json | 3 - .../20override_source/makedict/before.json | 12 --- .../20override_source/tiramisu/base.py | 15 ++-- .../40ifin_leadershipauto/makedict/after.json | 24 ------ .../40ifin_leadershipauto/makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../40ifin_leadershipauto/tiramisu/base.py | 19 ++-- .../makedict/after.json | 48 ----------- .../makedict/base.json | 12 --- .../makedict/before.json | 48 ----------- .../tiramisu/base.py | 35 +++----- .../makedict/after.json | 24 ------ .../45extra_without_family/makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../45extra_without_family/tiramisu/base.py | 19 ++-- .../60extra_group/makedict/after.json | 48 ----------- .../60extra_group/makedict/base.json | 12 --- .../60extra_group/makedict/before.json | 48 ----------- .../60extra_group/tiramisu/base.py | 35 +++----- .../60extra_help/makedict/after.json | 24 ------ .../60extra_help/makedict/base.json | 6 -- .../60extra_help/makedict/before.json | 24 ------ .../60extra_help/tiramisu/base.py | 19 ++-- .../70container_files/makedict/after.json | 48 ----------- .../70container_files/makedict/base.json | 12 --- .../70container_files/makedict/before.json | 48 ----------- .../70container_files/tiramisu/base.py | 34 +++----- .../makedict/after.json | 48 ----------- .../makedict/base.json | 12 --- .../makedict/before.json | 48 ----------- .../tiramisu/base.py | 35 +++----- .../makedict/after.json | 48 ----------- .../makedict/base.json | 12 --- .../makedict/before.json | 48 ----------- .../tiramisu/base.py | 39 ++++----- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 21 ++--- .../makedict/after.json | 72 ---------------- .../makedict/base.json | 18 ---- .../makedict/before.json | 72 ---------------- .../70container_files_twice/tiramisu/base.py | 45 ++++------ .../makedict/after.json | 48 ----------- .../70container_filesmulti/makedict/base.json | 12 --- .../makedict/before.json | 48 ----------- .../70container_filesmulti/tiramisu/base.py | 34 +++----- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- .../70service_not_managed/makedict/after.json | 24 ------ .../70service_not_managed/makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../70service_not_managed/tiramisu/base.py | 19 ++-- .../makedict/after.json | 24 ------ .../makedict/base.json | 6 -- .../makedict/before.json | 24 ------ .../tiramisu/base.py | 19 ++-- 176 files changed, 553 insertions(+), 3869 deletions(-) diff --git a/doc/dev/config.md b/doc/dev/config.md index 5e1210f8..b39d3646 100644 --- a/doc/dev/config.md +++ b/doc/dev/config.md @@ -14,7 +14,9 @@ Pour modifier il suffit de faire : RougailConfig[key] = value ``` -## Les répertoires des dictionnaires +## Configuration de chargement des dictionnaires + +### Les répertoires des dictionnaires Il existe deux types de répertoires de dictionnaires : @@ -36,7 +38,7 @@ RougailConfig['extra_dictionaries']['example'] = ['/dir1', '/dir2'] Les dictionnaires sont chargés dans le même ordre que les dictionnaires principaux. -## La DTD +### La DTD Rougail a besoin du fichier de DTD pour lire les fichiers dictionnaire. @@ -44,51 +46,75 @@ Par défaut le fichier de la DTD est dans le sous répertoire "data" du réperto Pour pouvez changer le répertoire de destination de la DTD et le nom du fichier avec la clef "dtdfilename". -## Le fichier de fonction +### Le fichier de fonction Le fichier qui contient les fonctions personnalisés est géré dans la clef "functions_file" et a comme valeur par défaut "/srv/rougail/functions.py". -## Le répertoire des templates - -Le répertoire des templates est géré dans la clef "templates_dir" et a comme valeur par défaut : "/srv/rougail/templates". - -## Le moteur de templates par défaut - -Le moteur de template est géré dans la clef "default_engine" et a comme valeur par défaut : "creole". Les valeurs possible sont "none", "creole" ou "jinja2". - -## Le répertoire des patchs - -Le répertoire des patches est géré dans la clef "patches_dir" et a comme valeur par défaut : "/srv/rougail/patches". - -## Le répertoire temporaire - -Le répertoire temporaire est utile lors de la génération de template. Il contient une copie des templates avec, éventuellement, les patches appliqués sur les templates. - -Le répertoire de temporaire est géré dans la clef "tmp_dir" et a comme valeur par défaut : "/srv/rougail/tmp". - -## Le répertoire de destination des fichiers générés - -Le répertoire de destination des fichiers générés est géré dans la clef "destinations_dir" et a comme valeur par défaut : "/srv/rougail/destinations". - -## La variable auto_freeze +### La variable auto_freeze La propriété auto_freeze n'est appliqué que une variable spécifique passe à True. Par défaut le nom de la variable est "instancied_module", mais il est possible de changer le nom de cette variable via la clef "auto_freeze_variable". -## Les modes +### Les modes Les modes sont personnalisables dans Rougail. Par défaut les modes sont "basic", "normal" et "expert". Il est possible de changer cette liste via la clef "modes_level". Si vous changer ces valeurs, penser à changer les modes par défaut des familles et des variables. -## Le mode par défaut pour une famille +### Le mode par défaut pour une famille Le mode par défaut d'une famille est "basic". Il est possible de changer le mode par défaut d'une famille via la clef "default_family_mode". -## Le mode par défaut pour une variable +### Le mode par défaut pour une variable Le mode par défaut d'une variable est "normal". Il est possible de changer le mode par défaut d'une variable via la clef "default_variable_mode". -## Le nom des fonctions internes +### Le nom des fonctions internes Il est possible d'ajouter des fonctions interne via la clef "internal_functions". + +## Configuration de la templatisation + +### Le répertoire des templates + +Le répertoire des templates est géré dans la clef "templates_dir" et a comme valeur par défaut : "/srv/rougail/templates". + +### Le répertoire des patchs + +Le répertoire des patches est géré dans la clef "patches_dir" et a comme valeur par défaut : "/srv/rougail/patches". + +### Le répertoire temporaire + +Le répertoire temporaire est utile lors de la génération de template. Il contient une copie des templates avec, éventuellement, les patches appliqués sur les templates. + +Le répertoire de temporaire est géré dans la clef "tmp_dir" et a comme valeur par défaut : "/srv/rougail/tmp". + +### Le répertoire de destination des fichiers générés + +Le répertoire de destination des fichiers générés est géré dans la clef "destinations_dir" et a comme valeur par défaut : "/srv/rougail/destinations". + +## La configuration par défaut des fichiers + +### Le moteur de templates par défaut + +Le moteur de template est géré dans la clef "default_files_engine" et a comme valeur par défaut : "creole". Les valeurs possible sont "none", "creole" ou "jinja2". + +### Les droits par défaut des fichiers + +Les droits des fichiers générés est géré dans la clef "default_files_mode" et a comme valeur par défaut : "0644". + +### Le propriétaire par défaut des fichiers + +Le propriétaire des fichiers générés est géré dans la clef "default_files_owner" et a comme valeur par défaut : "root". +Le groupe propriétaire des fichiers générés est géré dans la clef "default_files_group" et a comme valeur par défaut : "root". + +### La méthode d'inclusion par défaut des fichiers + +La méthode d'inclusion des fichiers générés est géré dans la clef "default_files_included" et a comme valeur par défaut : "no". Les valeurs possible sont "no", "name" et "content". + 'default_files_included': 'no', + +## La configuration par défaut des overrides + +### Le moteur de templates par défaut + +Le moteur de template est géré dans la clef "default_overrides_engine" et a comme valeur par défaut : "creole". Les valeurs possible sont "none", "creole" ou "jinja2". diff --git a/doc/service/file.md b/doc/service/file.md index d62697e5..589a5922 100644 --- a/doc/service/file.md +++ b/doc/service/file.md @@ -97,12 +97,14 @@ Attention : les deux variables "my_variable1" et "my_variable2" doivent être mu Par défaut les droits du fichier généré sont "0644" avec comme utilisateur "root" et groupe "root". -Il est possible de définir une autre valeur à un ou plusieurs de ces attributs : +Il est possible de définir les droits, l'utilisateur ou le groupe d'un fichier généré : ``` /etc/squid/squid.conf ``` +Il est possible de personnaliser les droits par défaut dans la [configuration de rougail](../dev/config.md) + ## Désactiver la génération d'un fichier Il est possible de définir une [condition](../condition/README.md) de type "disabled_if_in" ou "disabled_if_not_in" sur une balise fichier : @@ -150,6 +152,8 @@ Ou d'utiliser le moteur "jinja2" : /etc/squid/squid.conf ``` +Il est possible de personnaliser le moteur par défaut dans la [configuration de rougail](../dev/config.md) + ## Inclusion de template Un attribut "included" permet de définir la nature du fichier. Cet attribut peut avoir trois valeurs : @@ -166,3 +170,5 @@ Exemples : ``` Bien entendu, c'est au développeur de lister ou d'inclure le contenu de ce template dans le fichier de destination. Cet attribut permet juste de garantir que le fichier sera fait avant l'autre et de ne pas l'installer sur le serveur si ce n'est pas nécessaire. + +Il est possible de personnaliser les methodes d'inclusion par défaut dans la [configuration de rougail](../dev/config.md) diff --git a/doc/service/override.md b/doc/service/override.md index 8f036575..32b3e783 100644 --- a/doc/service/override.md +++ b/doc/service/override.md @@ -41,3 +41,5 @@ Ou d'utiliser le moteur "jinja2" : ``` ``` + +Il est possible de personnaliser le moteur par défaut dans la [configuration de rougail](../dev/config.md) diff --git a/src/rougail/annotator/service.py b/src/rougail/annotator/service.py index 809b9a8b..7b8a3d34 100644 --- a/src/rougail/annotator/service.py +++ b/src/rougail/annotator/service.py @@ -30,7 +30,6 @@ from typing import Tuple from ..i18n import _ from ..utils import normalize_family from ..error import DictConsistencyError -from ..config import RougailConfig # a object's attribute has some annotations # that shall not be present in the exported (flatened) XML ERASED_ATTRIBUTES = ('redefine', 'exists', 'optional', 'remove_check', 'namespace', @@ -97,6 +96,7 @@ class ServiceAnnotator: family = self._gen_family(eltname, path, service.xmlfiles, + with_informations=False, ) if isinstance(values, dict): values = list(values.values()) @@ -165,17 +165,21 @@ class ServiceAnnotator: dtd_key_type = elttype + '_type' else: dtd_key_type = key + '_type' - elt_type = getattr(elt, dtd_key_type, 'string') - if elt_type == 'variable': - elt_type = 'symlink' - family.variable.append(self._generate_element(elt_type, - dtd_key_type, - elttype, - key, - value, - elt, - f'{subpath}.{key}' - )) + elt_type = getattr(elt, dtd_key_type, None) + if elt_type: + if elt_type == 'variable': + elt_type = 'symlink' + family.variable.append(self._generate_element(elt_type, + dtd_key_type, + elttype, + key, + value, + elt, + f'{subpath}.{key}' + )) + else: + setattr(family.information, key, value) + family.variable.append(activate_obj) families.append(family) return families @@ -205,7 +209,8 @@ class ServiceAnnotator: def _gen_family(self, name, path, - xmlfiles + xmlfiles, + with_informations=True, ): family = self.objectspace.family(xmlfiles) family.name = normalize_family(name) @@ -216,6 +221,8 @@ class ServiceAnnotator: family, None, ) + if with_informations: + family.information = self.objectspace.information(xmlfiles) return family def _generate_element(self, @@ -263,8 +270,6 @@ class ServiceAnnotator: raise DictConsistencyError(msg, 69, override.xmlfiles) self.uniq_overrides.append(service_name) override.name = service_name - if not hasattr(override, 'engine'): - override.engine = RougailConfig['default_engine'] if not hasattr(override, 'source'): override.source = f'{service_name}.service' @@ -279,8 +284,6 @@ class ServiceAnnotator: msg = _(f'attribute "source" is mandatory for the file "{file_.name}" ' f'"({service_name})"') raise DictConsistencyError(msg, 34, file_.xmlfiles) - if not hasattr(file_, 'engine'): - file_.engine = RougailConfig['default_engine'] def _update_ip(self, ip, diff --git a/src/rougail/annotator/variable.py b/src/rougail/annotator/variable.py index cc492605..b6c7cbd3 100644 --- a/src/rougail/annotator/variable.py +++ b/src/rougail/annotator/variable.py @@ -229,12 +229,9 @@ class VariableAnnotator(Walk): # pylint: disable=R0903 """Convert variable help """ for variable in self.get_variables(): + if not hasattr(variable, 'help'): + continue if not hasattr(variable, 'information'): variable.information = self.objectspace.information(variable.xmlfiles) - self._convert_help(variable) - - @staticmethod - def _convert_help(variable) -> None: - if hasattr(variable, 'help'): variable.information.help = variable.help del variable.help diff --git a/src/rougail/config.py b/src/rougail/config.py index c5fd735b..7e0abd2f 100644 --- a/src/rougail/config.py +++ b/src/rougail/config.py @@ -42,9 +42,14 @@ RougailConfig = {'dictionaries_dir': [join(ROUGAILROOT, 'dictionaries')], 'functions_file': join(ROUGAILROOT, 'functions.py'), 'variable_namespace': 'rougail', 'auto_freeze_variable': 'server_deployed', - 'default_engine': 'creole', 'internal_functions': [], 'modes_level': ['basic', 'normal', 'expert'], 'default_family_mode': 'basic', 'default_variable_mode': 'normal', + 'default_files_engine': 'creole', + 'default_files_mode': '0644', + 'default_files_owner': 'root', + 'default_files_group': 'root', + 'default_files_included': 'no', + 'default_overrides_engine': 'creole', } diff --git a/src/rougail/data/rougail.dtd b/src/rougail/data/rougail.dtd index a3da5858..5c7a7713 100644 --- a/src/rougail/data/rougail.dtd +++ b/src/rougail/data/rougail.dtd @@ -62,13 +62,13 @@ - - - + + + - + @@ -83,6 +83,7 @@ + @@ -101,6 +102,7 @@ + diff --git a/src/rougail/template/base.py b/src/rougail/template/base.py index 66aaa661..5cad8ff5 100644 --- a/src/rougail/template/base.py +++ b/src/rougail/template/base.py @@ -34,10 +34,10 @@ from os.path import dirname, join, isfile, isdir, abspath try: - from tiramisu3 import Config + from tiramisu3 import Config, undefined from tiramisu3.error import PropertiesOptionError # pragma: no cover except ModuleNotFoundError: # pragma: no cover - from tiramisu import Config + from tiramisu import Config, undefined from tiramisu.error import PropertiesOptionError from ..config import RougailConfig @@ -55,6 +55,11 @@ log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) +INFORMATIONS = {'files': ['source', 'mode', 'owner', 'group', 'engine', 'included'], + 'overrides': ['name', 'source', 'engine'], + } + + class RougailLeaderIndex: """This object is create when access to a specified Index of the variable """ @@ -157,22 +162,26 @@ class RougailExtra: For example %%extra1.family.variable """ def __init__(self, - suboption: Dict) -> None: - self.suboption = suboption + suboption: Dict, + ) -> None: + self._suboption = suboption def __getattr__(self, key: str, ) -> Any: try: - return self.suboption[key] + return self._suboption[key] except KeyError: raise AttributeError(f'unable to find extra "{key}"') def __iter__(self): - return iter(self.suboption.values()) + return iter(self._suboption.values()) def items(self): - return self.suboption.items() + return self._suboption.items() + + def __str__(self): + return f'' class RougailBaseTemplate: @@ -286,9 +295,14 @@ class RougailBaseTemplate: chdir(self.templates_dir) for option in await self.config.option.list(type='all'): namespace = await option.option.name() - is_var_namespace = namespace == self.rougailconfig['variable_namespace'] + is_variable_namespace = namespace == self.rougailconfig['variable_namespace'] + if namespace == 'services': + is_service_namespace = 'root' + else: + is_service_namespace = False self.rougail_variables_dict[namespace] = await self.load_variables(option, - is_var_namespace, + is_variable_namespace, + is_service_namespace, ) for template in listdir('.'): self.prepare_template(template) @@ -303,6 +317,7 @@ class RougailBaseTemplate: type_ = await fills.option.name() for fill_obj in await fills.list('all'): fill = await fill_obj.value.dict() + await self.get_informations(type_, fill, fill_obj) if 'included' in fill: if (fill['included'] == 'no' and included is True) or \ (fill['included'] != 'no' and included is False): @@ -317,6 +332,19 @@ class RougailBaseTemplate: self.post_instance() chdir(ori_dir) + async def get_informations(self, + type_: str, + dico: dict, + obj: 'Option', + ) -> None: + for key in INFORMATIONS.get(type_, []): + default_key = f'default_{type_}_{key}' + if default_key in RougailConfig: + default_value = RougailConfig[default_key] + else: + default_value = undefined + dico[key] = await obj.information.get(key, default_value) + def desactive_service(self, service_name: str, ): @@ -345,7 +373,8 @@ class RougailBaseTemplate: async def load_variables(self, optiondescription, - is_variable_namespace, + is_variable_namespace: str, + is_service_namespace: str, ) -> RougailExtra: """Load all variables and set it in RougailExtra objects """ @@ -366,8 +395,18 @@ class RougailBaseTemplate: ) variables[leader_name] = leader else: + if is_service_namespace == 'root': + new_is_service_namespace = 'service_name' + elif is_service_namespace == 'service_name': + new_is_service_namespace = await option.option.name() + elif is_service_namespace in INFORMATIONS: + # remove 's' + new_is_service_namespace = is_service_namespace[:-1] + else: + new_is_service_namespace = is_service_namespace subfamilies = await self.load_variables(option, is_variable_namespace, + new_is_service_namespace, ) variables[await option.option.name()] = subfamilies else: @@ -382,4 +421,9 @@ class RougailBaseTemplate: else: value = await option.value.get() variables[await option.option.name()] = value + if isinstance(is_service_namespace, str) and is_service_namespace + 's' in INFORMATIONS: + await self.get_informations(is_service_namespace + 's', + variables, + optiondescription, + ) return RougailExtra(variables) diff --git a/tests/dictionaries/01base_file/makedict/after.json b/tests/dictionaries/01base_file/makedict/after.json index c33b61b6..c8edf346 100644 --- a/tests/dictionaries/01base_file/makedict/after.json +++ b/tests/dictionaries/01base_file/makedict/after.json @@ -3,66 +3,18 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/etc/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file/makedict/base.json b/tests/dictionaries/01base_file/makedict/base.json index 4aeec3f1..c9048468 100644 --- a/tests/dictionaries/01base_file/makedict/base.json +++ b/tests/dictionaries/01base_file/makedict/base.json @@ -1,20 +1,8 @@ { "rougail.general.mode_conteneur_actif": "non", - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": true, - "services.test.files.file2.engine": "jinja2", - "services.test.files.file2.group": "root", - "services.test.files.file2.included": "no", - "services.test.files.file2.mode": "0644", "services.test.files.file2.name": "/etc/file2", - "services.test.files.file2.owner": "root", - "services.test.files.file2.source": "file2", "services.test.files.file2.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/01base_file/makedict/before.json b/tests/dictionaries/01base_file/makedict/before.json index c33b61b6..c8edf346 100644 --- a/tests/dictionaries/01base_file/makedict/before.json +++ b/tests/dictionaries/01base_file/makedict/before.json @@ -3,66 +3,18 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/etc/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file/tiramisu/base.py b/tests/dictionaries/01base_file/tiramisu/base.py index 340e122d..5cceee7b 100644 --- a/tests/dictionaries/01base_file/tiramisu/base.py +++ b/tests/dictionaries/01base_file/tiramisu/base.py @@ -14,27 +14,18 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/file") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="file") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) -option_17 = StrOption(name="engine", doc="engine", default="jinja2") -option_18 = StrOption(name="group", doc="group", default="root") -option_19 = StrOption(name="included", doc="included", default="no") -option_20 = StrOption(name="mode", doc="mode", default="0644") -option_21 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_22 = StrOption(name="owner", doc="owner", default="root") -option_23 = StrOption(name="source", doc="source", default="file2") -option_24 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="file2", doc="file2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24]) -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16]) -option_25 = BoolOption(name="activate", doc="activate", default=True) -option_26 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_25, option_26]) +option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) +option_7.impl_set_information('source', "file") +option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) +option_10.impl_set_information('engine', "jinja2") +option_10.impl_set_information('source', "file2") +option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) +option_13 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_13, option_14]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/01base_file_include/makedict/after.json b/tests/dictionaries/01base_file_include/makedict/after.json index c33b61b6..c8edf346 100644 --- a/tests/dictionaries/01base_file_include/makedict/after.json +++ b/tests/dictionaries/01base_file_include/makedict/after.json @@ -3,66 +3,18 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/etc/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file_include/makedict/base.json b/tests/dictionaries/01base_file_include/makedict/base.json index 4aeec3f1..c9048468 100644 --- a/tests/dictionaries/01base_file_include/makedict/base.json +++ b/tests/dictionaries/01base_file_include/makedict/base.json @@ -1,20 +1,8 @@ { "rougail.general.mode_conteneur_actif": "non", - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": true, - "services.test.files.file2.engine": "jinja2", - "services.test.files.file2.group": "root", - "services.test.files.file2.included": "no", - "services.test.files.file2.mode": "0644", "services.test.files.file2.name": "/etc/file2", - "services.test.files.file2.owner": "root", - "services.test.files.file2.source": "file2", "services.test.files.file2.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/01base_file_include/makedict/before.json b/tests/dictionaries/01base_file_include/makedict/before.json index c33b61b6..c8edf346 100644 --- a/tests/dictionaries/01base_file_include/makedict/before.json +++ b/tests/dictionaries/01base_file_include/makedict/before.json @@ -3,66 +3,18 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/etc/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file_include/tiramisu/base.py b/tests/dictionaries/01base_file_include/tiramisu/base.py index 340e122d..5cceee7b 100644 --- a/tests/dictionaries/01base_file_include/tiramisu/base.py +++ b/tests/dictionaries/01base_file_include/tiramisu/base.py @@ -14,27 +14,18 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/file") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="file") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) -option_17 = StrOption(name="engine", doc="engine", default="jinja2") -option_18 = StrOption(name="group", doc="group", default="root") -option_19 = StrOption(name="included", doc="included", default="no") -option_20 = StrOption(name="mode", doc="mode", default="0644") -option_21 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_22 = StrOption(name="owner", doc="owner", default="root") -option_23 = StrOption(name="source", doc="source", default="file2") -option_24 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="file2", doc="file2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24]) -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16]) -option_25 = BoolOption(name="activate", doc="activate", default=True) -option_26 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_25, option_26]) +option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) +option_7.impl_set_information('source', "file") +option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) +option_10.impl_set_information('engine', "jinja2") +option_10.impl_set_information('source', "file2") +option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) +option_13 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_13, option_14]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/01base_file_include_content/makedict/after.json b/tests/dictionaries/01base_file_include_content/makedict/after.json index 2c6484dd..0f9e1770 100644 --- a/tests/dictionaries/01base_file_include_content/makedict/after.json +++ b/tests/dictionaries/01base_file_include_content/makedict/after.json @@ -3,98 +3,26 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/etc/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true }, - "services.test.files.incfile.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.incfile.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.incfile.included": { - "owner": "default", - "value": "content" - }, - "services.test.files.incfile.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.incfile.name": { "owner": "default", "value": "/etc/dir/incfile" }, - "services.test.files.incfile.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.incfile.source": { - "owner": "default", - "value": "incfile" - }, "services.test.files.incfile.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file_include_content/makedict/base.json b/tests/dictionaries/01base_file_include_content/makedict/base.json index 39e9f290..68409c43 100644 --- a/tests/dictionaries/01base_file_include_content/makedict/base.json +++ b/tests/dictionaries/01base_file_include_content/makedict/base.json @@ -1,28 +1,10 @@ { "rougail.general.mode_conteneur_actif": "non", - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": true, - "services.test.files.file2.engine": "jinja2", - "services.test.files.file2.group": "root", - "services.test.files.file2.included": "no", - "services.test.files.file2.mode": "0644", "services.test.files.file2.name": "/etc/file2", - "services.test.files.file2.owner": "root", - "services.test.files.file2.source": "file2", "services.test.files.file2.activate": true, - "services.test.files.incfile.engine": "creole", - "services.test.files.incfile.group": "root", - "services.test.files.incfile.included": "content", - "services.test.files.incfile.mode": "0644", "services.test.files.incfile.name": "/etc/dir/incfile", - "services.test.files.incfile.owner": "root", - "services.test.files.incfile.source": "incfile", "services.test.files.incfile.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/01base_file_include_content/makedict/before.json b/tests/dictionaries/01base_file_include_content/makedict/before.json index 2c6484dd..0f9e1770 100644 --- a/tests/dictionaries/01base_file_include_content/makedict/before.json +++ b/tests/dictionaries/01base_file_include_content/makedict/before.json @@ -3,98 +3,26 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/etc/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true }, - "services.test.files.incfile.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.incfile.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.incfile.included": { - "owner": "default", - "value": "content" - }, - "services.test.files.incfile.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.incfile.name": { "owner": "default", "value": "/etc/dir/incfile" }, - "services.test.files.incfile.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.incfile.source": { - "owner": "default", - "value": "incfile" - }, "services.test.files.incfile.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file_include_content/tiramisu/base.py b/tests/dictionaries/01base_file_include_content/tiramisu/base.py index 9eb2c680..f1fd9d2c 100644 --- a/tests/dictionaries/01base_file_include_content/tiramisu/base.py +++ b/tests/dictionaries/01base_file_include_content/tiramisu/base.py @@ -14,36 +14,23 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/file") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="file") +option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) +option_7.impl_set_information('source', "file") +option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) +option_10.impl_set_information('engine', "jinja2") +option_10.impl_set_information('source', "file2") +option_14 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) -option_17 = StrOption(name="engine", doc="engine", default="jinja2") -option_18 = StrOption(name="group", doc="group", default="root") -option_19 = StrOption(name="included", doc="included", default="no") -option_20 = StrOption(name="mode", doc="mode", default="0644") -option_21 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_22 = StrOption(name="owner", doc="owner", default="root") -option_23 = StrOption(name="source", doc="source", default="file2") -option_24 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="file2", doc="file2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24]) -option_26 = StrOption(name="engine", doc="engine", default="creole") -option_27 = StrOption(name="group", doc="group", default="root") -option_28 = StrOption(name="included", doc="included", default="content") -option_29 = StrOption(name="mode", doc="mode", default="0644") -option_30 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") -option_31 = StrOption(name="owner", doc="owner", default="root") -option_32 = StrOption(name="source", doc="source", default="incfile") -option_33 = BoolOption(name="activate", doc="activate", default=True) -option_25 = OptionDescription(name="incfile", doc="incfile", children=[option_26, option_27, option_28, option_29, option_30, option_31, option_32, option_33]) -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16, option_25]) -option_34 = BoolOption(name="activate", doc="activate", default=True) -option_35 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_34, option_35]) +option_13 = OptionDescription(name="incfile", doc="incfile", children=[option_14, option_15]) +option_13.impl_set_information('included', "content") +option_13.impl_set_information('source', "incfile") +option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13]) +option_16 = BoolOption(name="activate", doc="activate", default=True) +option_17 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/01base_file_include_name/makedict/after.json b/tests/dictionaries/01base_file_include_name/makedict/after.json index 16f8fcca..0f9e1770 100644 --- a/tests/dictionaries/01base_file_include_name/makedict/after.json +++ b/tests/dictionaries/01base_file_include_name/makedict/after.json @@ -3,98 +3,26 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/etc/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true }, - "services.test.files.incfile.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.incfile.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.incfile.included": { - "owner": "default", - "value": "name" - }, - "services.test.files.incfile.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.incfile.name": { "owner": "default", "value": "/etc/dir/incfile" }, - "services.test.files.incfile.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.incfile.source": { - "owner": "default", - "value": "incfile" - }, "services.test.files.incfile.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file_include_name/makedict/base.json b/tests/dictionaries/01base_file_include_name/makedict/base.json index a7d36dac..68409c43 100644 --- a/tests/dictionaries/01base_file_include_name/makedict/base.json +++ b/tests/dictionaries/01base_file_include_name/makedict/base.json @@ -1,28 +1,10 @@ { "rougail.general.mode_conteneur_actif": "non", - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": true, - "services.test.files.file2.engine": "jinja2", - "services.test.files.file2.group": "root", - "services.test.files.file2.included": "no", - "services.test.files.file2.mode": "0644", "services.test.files.file2.name": "/etc/file2", - "services.test.files.file2.owner": "root", - "services.test.files.file2.source": "file2", "services.test.files.file2.activate": true, - "services.test.files.incfile.engine": "creole", - "services.test.files.incfile.group": "root", - "services.test.files.incfile.included": "name", - "services.test.files.incfile.mode": "0644", "services.test.files.incfile.name": "/etc/dir/incfile", - "services.test.files.incfile.owner": "root", - "services.test.files.incfile.source": "incfile", "services.test.files.incfile.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/01base_file_include_name/makedict/before.json b/tests/dictionaries/01base_file_include_name/makedict/before.json index 16f8fcca..0f9e1770 100644 --- a/tests/dictionaries/01base_file_include_name/makedict/before.json +++ b/tests/dictionaries/01base_file_include_name/makedict/before.json @@ -3,98 +3,26 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/etc/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true }, - "services.test.files.incfile.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.incfile.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.incfile.included": { - "owner": "default", - "value": "name" - }, - "services.test.files.incfile.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.incfile.name": { "owner": "default", "value": "/etc/dir/incfile" }, - "services.test.files.incfile.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.incfile.source": { - "owner": "default", - "value": "incfile" - }, "services.test.files.incfile.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file_include_name/tiramisu/base.py b/tests/dictionaries/01base_file_include_name/tiramisu/base.py index 4fe855ae..b8c816a3 100644 --- a/tests/dictionaries/01base_file_include_name/tiramisu/base.py +++ b/tests/dictionaries/01base_file_include_name/tiramisu/base.py @@ -14,36 +14,23 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/file") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="file") +option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) +option_7.impl_set_information('source', "file") +option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) +option_10.impl_set_information('engine', "jinja2") +option_10.impl_set_information('source', "file2") +option_14 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) -option_17 = StrOption(name="engine", doc="engine", default="jinja2") -option_18 = StrOption(name="group", doc="group", default="root") -option_19 = StrOption(name="included", doc="included", default="no") -option_20 = StrOption(name="mode", doc="mode", default="0644") -option_21 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_22 = StrOption(name="owner", doc="owner", default="root") -option_23 = StrOption(name="source", doc="source", default="file2") -option_24 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="file2", doc="file2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24]) -option_26 = StrOption(name="engine", doc="engine", default="creole") -option_27 = StrOption(name="group", doc="group", default="root") -option_28 = StrOption(name="included", doc="included", default="name") -option_29 = StrOption(name="mode", doc="mode", default="0644") -option_30 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile") -option_31 = StrOption(name="owner", doc="owner", default="root") -option_32 = StrOption(name="source", doc="source", default="incfile") -option_33 = BoolOption(name="activate", doc="activate", default=True) -option_25 = OptionDescription(name="incfile", doc="incfile", children=[option_26, option_27, option_28, option_29, option_30, option_31, option_32, option_33]) -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16, option_25]) -option_34 = BoolOption(name="activate", doc="activate", default=True) -option_35 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_34, option_35]) +option_13 = OptionDescription(name="incfile", doc="incfile", children=[option_14, option_15]) +option_13.impl_set_information('included', "name") +option_13.impl_set_information('source', "incfile") +option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13]) +option_16 = BoolOption(name="activate", doc="activate", default=True) +option_17 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/01base_file_patch/makedict/after.json b/tests/dictionaries/01base_file_patch/makedict/after.json index c33b61b6..c8edf346 100644 --- a/tests/dictionaries/01base_file_patch/makedict/after.json +++ b/tests/dictionaries/01base_file_patch/makedict/after.json @@ -3,66 +3,18 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/etc/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file_patch/makedict/base.json b/tests/dictionaries/01base_file_patch/makedict/base.json index 4aeec3f1..c9048468 100644 --- a/tests/dictionaries/01base_file_patch/makedict/base.json +++ b/tests/dictionaries/01base_file_patch/makedict/base.json @@ -1,20 +1,8 @@ { "rougail.general.mode_conteneur_actif": "non", - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": true, - "services.test.files.file2.engine": "jinja2", - "services.test.files.file2.group": "root", - "services.test.files.file2.included": "no", - "services.test.files.file2.mode": "0644", "services.test.files.file2.name": "/etc/file2", - "services.test.files.file2.owner": "root", - "services.test.files.file2.source": "file2", "services.test.files.file2.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/01base_file_patch/makedict/before.json b/tests/dictionaries/01base_file_patch/makedict/before.json index c33b61b6..c8edf346 100644 --- a/tests/dictionaries/01base_file_patch/makedict/before.json +++ b/tests/dictionaries/01base_file_patch/makedict/before.json @@ -3,66 +3,18 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/etc/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file_patch/tiramisu/base.py b/tests/dictionaries/01base_file_patch/tiramisu/base.py index 340e122d..5cceee7b 100644 --- a/tests/dictionaries/01base_file_patch/tiramisu/base.py +++ b/tests/dictionaries/01base_file_patch/tiramisu/base.py @@ -14,27 +14,18 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/file") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="file") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) -option_17 = StrOption(name="engine", doc="engine", default="jinja2") -option_18 = StrOption(name="group", doc="group", default="root") -option_19 = StrOption(name="included", doc="included", default="no") -option_20 = StrOption(name="mode", doc="mode", default="0644") -option_21 = FilenameOption(name="name", doc="name", default="/etc/file2") -option_22 = StrOption(name="owner", doc="owner", default="root") -option_23 = StrOption(name="source", doc="source", default="file2") -option_24 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="file2", doc="file2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24]) -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16]) -option_25 = BoolOption(name="activate", doc="activate", default=True) -option_26 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_25, option_26]) +option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) +option_7.impl_set_information('source', "file") +option_11 = FilenameOption(name="name", doc="name", default="/etc/file2") +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12]) +option_10.impl_set_information('engine', "jinja2") +option_10.impl_set_information('source', "file2") +option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) +option_13 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_13, option_14]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/01base_file_utfchar/makedict/after.json b/tests/dictionaries/01base_file_utfchar/makedict/after.json index 4d11276c..443ae742 100644 --- a/tests/dictionaries/01base_file_utfchar/makedict/after.json +++ b/tests/dictionaries/01base_file_utfchar/makedict/after.json @@ -3,66 +3,18 @@ "owner": "default", "value": "non" }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.name": { "owner": "default", "value": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel" }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.source": { - "owner": "default", - "value": "systemd-makefs@dev-disk-by\\x2dpartlabel" - }, "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.activate": { "owner": "default", "value": true }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.name": { "owner": "default", "value": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2" }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.source": { - "owner": "default", - "value": "systemd-makefs@dev-disk-by\\x2dpartlabel2" - }, "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file_utfchar/makedict/base.json b/tests/dictionaries/01base_file_utfchar/makedict/base.json index 75dfca14..2ae7cd2f 100644 --- a/tests/dictionaries/01base_file_utfchar/makedict/base.json +++ b/tests/dictionaries/01base_file_utfchar/makedict/base.json @@ -1,20 +1,8 @@ { "rougail.general.mode_conteneur_actif": "non", - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.engine": "creole", - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.group": "root", - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.included": "no", - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.mode": "0644", "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.name": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel", - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.owner": "root", - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.source": "systemd-makefs@dev-disk-by\\x2dpartlabel", "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.activate": true, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.engine": "jinja2", - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.group": "root", - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.included": "no", - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.mode": "0644", "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.name": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2", - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.owner": "root", - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.source": "systemd-makefs@dev-disk-by\\x2dpartlabel2", "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/01base_file_utfchar/makedict/before.json b/tests/dictionaries/01base_file_utfchar/makedict/before.json index 4d11276c..443ae742 100644 --- a/tests/dictionaries/01base_file_utfchar/makedict/before.json +++ b/tests/dictionaries/01base_file_utfchar/makedict/before.json @@ -3,66 +3,18 @@ "owner": "default", "value": "non" }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.name": { "owner": "default", "value": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel" }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.source": { - "owner": "default", - "value": "systemd-makefs@dev-disk-by\\x2dpartlabel" - }, "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.activate": { "owner": "default", "value": true }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.name": { "owner": "default", "value": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2" }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.source": { - "owner": "default", - "value": "systemd-makefs@dev-disk-by\\x2dpartlabel2" - }, "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/01base_file_utfchar/tiramisu/base.py b/tests/dictionaries/01base_file_utfchar/tiramisu/base.py index 9544822b..efd63225 100644 --- a/tests/dictionaries/01base_file_utfchar/tiramisu/base.py +++ b/tests/dictionaries/01base_file_utfchar/tiramisu/base.py @@ -14,27 +14,18 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="systemd-makefs@dev-disk-by\\x2dpartlabel") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) -option_17 = StrOption(name="engine", doc="engine", default="jinja2") -option_18 = StrOption(name="group", doc="group", default="root") -option_19 = StrOption(name="included", doc="included", default="no") -option_20 = StrOption(name="mode", doc="mode", default="0644") -option_21 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2") -option_22 = StrOption(name="owner", doc="owner", default="root") -option_23 = StrOption(name="source", doc="source", default="systemd-makefs@dev-disk-by\\x2dpartlabel2") -option_24 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24]) -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16]) -option_25 = BoolOption(name="activate", doc="activate", default=True) -option_26 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_25, option_26]) +option_8 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_8, option_9]) +option_7.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel") +option_11 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2") +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_10 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_11, option_12]) +option_10.impl_set_information('engine', "jinja2") +option_10.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel2") +option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) +option_13 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_13, option_14]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/after.json b/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/after.json index 9b9471c1..465294dd 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/after.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/after.json @@ -11,34 +11,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/base.json b/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/base.json index fd3b2474..f4ceb046 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/base.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/base.json @@ -2,13 +2,7 @@ "rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/before.json b/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/before.json index 9b9471c1..465294dd 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/before.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param/makedict/before.json @@ -11,34 +11,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py index d52b30b7..32973eeb 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non" option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) +option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) +option_9.impl_set_information('source', "file1") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/after.json b/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/after.json index 97022e70..c9549083 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/after.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/after.json @@ -11,34 +11,10 @@ "owner": "default", "value": "no" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/base.json b/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/base.json index bf0ac0f1..16da02ea 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/base.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/base.json @@ -2,13 +2,7 @@ "rougail.general.condition": "no", "rougail.general.condition2": "no", "rougail.general.test_variable": "no", - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/before.json b/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/before.json index 97022e70..c9549083 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/before.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param2/makedict/before.json @@ -11,34 +11,10 @@ "owner": "default", "value": "no" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py index d1247ffa..630e84d0 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param2/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="condition2", doc="No change", default="no", propertie option_5 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) +option_9.impl_set_information('source', "file1") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/after.json b/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/after.json index 68b5803d..fd86985c 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/after.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/after.json @@ -7,34 +7,10 @@ "owner": "default", "value": "no" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/base.json b/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/base.json index 1df1f7e5..2d19d40a 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/base.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/base.json @@ -1,13 +1,7 @@ { "rougail.general.condition": "no", "rougail.general.condition2": "no", - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": false, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/before.json b/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/before.json index 68b5803d..fd86985c 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/before.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param3/makedict/before.json @@ -7,34 +7,10 @@ "owner": "default", "value": "no" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py index 163d7bc3..3be64117 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param3/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="condition2", doc="No change", default="no", propertie option_5 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) +option_9.impl_set_information('source', "file1") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/after.json b/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/after.json index 310e1638..15742a7a 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/after.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/after.json @@ -7,34 +7,10 @@ "owner": "default", "value": "no" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/base.json b/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/base.json index 030a9425..728fe8b4 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/base.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/base.json @@ -1,13 +1,7 @@ { "rougail.general.condition": "yes", "rougail.general.condition2": "no", - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/before.json b/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/before.json index 310e1638..15742a7a 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/before.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param4/makedict/before.json @@ -7,34 +7,10 @@ "owner": "default", "value": "no" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py index db26c7d4..5aae7fb0 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param4/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="condition2", doc="No change", default="no", propertie option_5 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) +option_9.impl_set_information('source', "file1") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/after.json b/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/after.json index d0140339..dfe546f1 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/after.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/after.json @@ -7,34 +7,10 @@ "owner": "default", "value": "yes" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/base.json b/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/base.json index 0ec41763..3c256d76 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/base.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/base.json @@ -1,13 +1,7 @@ { "rougail.general.condition": "yes", "rougail.general.condition2": "yes", - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": false, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/before.json b/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/before.json index d0140339..dfe546f1 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/before.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param5/makedict/before.json @@ -7,34 +7,10 @@ "owner": "default", "value": "yes" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py index cb1ba8f8..39957266 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param5/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="condition2", doc="No change", default="yes", properti option_5 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) +option_9.impl_set_information('source', "file1") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/after.json b/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/after.json index 1995ed41..1085d3ec 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/after.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/after.json @@ -7,34 +7,10 @@ "owner": "default", "value": "yes" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/base.json b/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/base.json index 9fde9a9d..089759dc 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/base.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/base.json @@ -1,13 +1,7 @@ { "rougail.general.condition": "no", "rougail.general.condition2": "yes", - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": false, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/before.json b/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/before.json index 1995ed41..1085d3ec 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/before.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param6/makedict/before.json @@ -7,34 +7,10 @@ "owner": "default", "value": "yes" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py index 458930f2..3f81787c 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param6/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="condition2", doc="No change", default="yes", properti option_5 = StrOption(name="test_variable", doc="No change", default="no", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe"), 'reverse_condition': ParamValue(True)})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("yes")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_4, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4, notraisepropertyerror=True), 'expected_1': ParamValue(["yes", "maybe"])}))) +option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) +option_9.impl_set_information('source', "file1") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/after.json b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/after.json index ca062acc..3d60ca6a 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/after.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/after.json @@ -3,34 +3,10 @@ "owner": "default", "value": "oui" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/base.json b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/base.json index ca7c5bae..0190e501 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/base.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/base.json @@ -1,12 +1,6 @@ { "rougail.general.condition": "oui", - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": false, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/before.json b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/before.json index ca062acc..3d60ca6a 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/before.json +++ b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/makedict/before.json @@ -3,34 +3,10 @@ "owner": "default", "value": "oui" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py index 3abc58ac..051e6a7c 100644 --- a/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_in_multi_param_disabled/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non" option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("maybe")}))})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(["oui", "maybe"]), 'condition_operator': ParamValue("OR")}))) +option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) +option_9.impl_set_information('source', "file1") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/after.json b/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/after.json index 260109ff..4fc26870 100644 --- a/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/after.json +++ b/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/after.json @@ -7,34 +7,10 @@ "owner": "default", "value": "no" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/base.json b/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/base.json index a7732a1f..431665f1 100644 --- a/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/base.json +++ b/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/base.json @@ -1,13 +1,7 @@ { "rougail.general.condition": "no", "rougail.general.disable_variable": "no", - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/before.json b/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/before.json index 260109ff..4fc26870 100644 --- a/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/before.json +++ b/tests/dictionaries/10load_disabled_if_not_in_fallback/makedict/before.json @@ -7,34 +7,10 @@ "owner": "default", "value": "no" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/10load_disabled_if_not_in_fallback/tiramisu/base.py b/tests/dictionaries/10load_disabled_if_not_in_fallback/tiramisu/base.py index 170302ea..11a6c060 100644 --- a/tests/dictionaries/10load_disabled_if_not_in_fallback/tiramisu/base.py +++ b/tests/dictionaries/10load_disabled_if_not_in_fallback/tiramisu/base.py @@ -15,18 +15,13 @@ option_3 = StrOption(name="condition", doc="No change", default="no", properties option_4 = StrOption(name="disable_variable", doc="No change", default="no", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_9 = StrOption(name="engine", doc="engine", default="creole") -option_10 = StrOption(name="group", doc="group", default="root") -option_11 = StrOption(name="included", doc="included", default="no") -option_12 = StrOption(name="mode", doc="mode", default="0644") -option_13 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_14 = StrOption(name="owner", doc="owner", default="root") -option_15 = StrOption(name="source", doc="source", default="file1") -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_8 = OptionDescription(name="file1", doc="file1", children=[option_9, option_10, option_11, option_12, option_13, option_14, option_15, option_16]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_10 = BoolOption(name="activate", doc="activate", default=True) +option_8 = OptionDescription(name="file1", doc="file1", children=[option_9, option_10]) +option_8.impl_set_information('source', "file1") option_7 = OptionDescription(name="files", doc="files", children=[option_8]) -option_17 = BoolOption(name="activate", doc="activate", default=True) -option_18 = BoolOption(name="manage", doc="manage", default=True) -option_6 = OptionDescription(name="test", doc="test", children=[option_7, option_17, option_18]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_12 = BoolOption(name="manage", doc="manage", default=True) +option_6 = OptionDescription(name="test", doc="test", children=[option_7, option_11, option_12]) option_5 = OptionDescription(name="services", doc="services", children=[option_6], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) diff --git a/tests/dictionaries/11disabled_if_in_filelist/makedict/after.json b/tests/dictionaries/11disabled_if_in_filelist/makedict/after.json index 75e27edb..14937b25 100644 --- a/tests/dictionaries/11disabled_if_in_filelist/makedict/after.json +++ b/tests/dictionaries/11disabled_if_in_filelist/makedict/after.json @@ -11,34 +11,10 @@ "owner": "default", "value": true }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/11disabled_if_in_filelist/makedict/base.json b/tests/dictionaries/11disabled_if_in_filelist/makedict/base.json index f2fd3666..05d18c18 100644 --- a/tests/dictionaries/11disabled_if_in_filelist/makedict/base.json +++ b/tests/dictionaries/11disabled_if_in_filelist/makedict/base.json @@ -2,13 +2,7 @@ "rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": true, - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/11disabled_if_in_filelist/makedict/before.json b/tests/dictionaries/11disabled_if_in_filelist/makedict/before.json index 75e27edb..14937b25 100644 --- a/tests/dictionaries/11disabled_if_in_filelist/makedict/before.json +++ b/tests/dictionaries/11disabled_if_in_filelist/makedict/before.json @@ -11,34 +11,10 @@ "owner": "default", "value": true }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py index c867565c..8da62c74 100644 --- a/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non" option_5 = BoolOption(name="mode_conteneur_actif2", doc="No change", default=True, properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/etc/file") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/etc/file") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) +option_9.impl_set_information('source', "file") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/after.json b/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/after.json index eff249b1..2d2b3390 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/after.json +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/after.json @@ -3,34 +3,10 @@ "owner": "default", "value": true }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/base.json b/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/base.json index e031fca5..e0b590dc 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/base.json +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/base.json @@ -1,12 +1,6 @@ { "rougail.general.condition": true, - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": false, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/before.json b/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/before.json index eff249b1..2d2b3390 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/before.json +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean/makedict/before.json @@ -3,34 +3,10 @@ "owner": "default", "value": true }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py index acf353d6..96743d30 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean/tiramisu/base.py @@ -14,18 +14,13 @@ except: option_3 = BoolOption(name="condition", doc="condition", default=True, properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="file1") -option_15 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) -option_7 = OptionDescription(name="file1", doc="file1", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) +option_8 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) +option_7 = OptionDescription(name="file1", doc="file1", children=[option_8, option_9]) +option_7.impl_set_information('source', "file1") option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_17 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17]) +option_10 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_10, option_11]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/after.json b/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/after.json index df82f9b0..a7cf2fa1 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/after.json +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/after.json @@ -3,34 +3,10 @@ "owner": "default", "value": false }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/base.json b/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/base.json index 4b7d64d9..1920d6a3 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/base.json +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/base.json @@ -1,12 +1,6 @@ { "rougail.general.condition": false, - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/before.json b/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/before.json index df82f9b0..a7cf2fa1 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/before.json +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean2/makedict/before.json @@ -3,34 +3,10 @@ "owner": "default", "value": false }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py index d44a6fbc..e9d36a21 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_boolean2/tiramisu/base.py @@ -14,18 +14,13 @@ except: option_3 = BoolOption(name="condition", doc="condition", default=False, properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="file1") -option_15 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) -option_7 = OptionDescription(name="file1", doc="file1", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) +option_8 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_9 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue(True)}))) +option_7 = OptionDescription(name="file1", doc="file1", children=[option_8, option_9]) +option_7.impl_set_information('source', "file1") option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_17 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17]) +option_10 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_10, option_11]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/after.json b/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/after.json index 62ad099f..9c46a022 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/after.json +++ b/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/after.json @@ -3,34 +3,10 @@ "owner": "default", "value": "oui" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/base.json b/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/base.json index 332511ae..a7466708 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/base.json +++ b/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/base.json @@ -1,12 +1,6 @@ { "rougail.general.condition": "oui", - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": false, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/before.json b/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/before.json index 62ad099f..9c46a022 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/before.json +++ b/tests/dictionaries/11disabled_if_in_filelist_disabled/makedict/before.json @@ -3,34 +3,10 @@ "owner": "default", "value": "oui" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py index 8e122af1..fe3bb4be 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_disabled/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non" option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/etc/file") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/etc/file") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) +option_9.impl_set_information('source', "file") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/after.json b/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/after.json index 5c33f2a1..f09965a8 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/after.json +++ b/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/after.json @@ -11,66 +11,18 @@ "owner": "default", "value": "non" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/tmp/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/base.json b/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/base.json index 5590d9b3..0e923582 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/base.json +++ b/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/base.json @@ -2,21 +2,9 @@ "rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": true, - "services.test.files.file2.engine": "creole", - "services.test.files.file2.group": "root", - "services.test.files.file2.included": "no", - "services.test.files.file2.mode": "0644", "services.test.files.file2.name": "/tmp/file2", - "services.test.files.file2.owner": "root", - "services.test.files.file2.source": "file2", "services.test.files.file2.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/before.json b/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/before.json index 5c33f2a1..f09965a8 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/before.json +++ b/tests/dictionaries/11disabled_if_in_filelist_multi/makedict/before.json @@ -11,66 +11,18 @@ "owner": "default", "value": "non" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": true }, - "services.test.files.file2.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file2.name": { "owner": "default", "value": "/tmp/file2" }, - "services.test.files.file2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file2.source": { - "owner": "default", - "value": "file2" - }, "services.test.files.file2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py b/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py index 4bd9cc16..ecff691e 100644 --- a/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py +++ b/tests/dictionaries/11disabled_if_in_filelist_multi/tiramisu/base.py @@ -16,27 +16,17 @@ option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non" option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True, notraisepropertyerror=True), 'expected': ParamValue("oui")}))})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file1") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) -option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) -option_19 = StrOption(name="engine", doc="engine", default="creole") -option_20 = StrOption(name="group", doc="group", default="root") -option_21 = StrOption(name="included", doc="included", default="no") -option_22 = StrOption(name="mode", doc="mode", default="0644") -option_23 = FilenameOption(name="name", doc="name", default="/tmp/file2") -option_24 = StrOption(name="owner", doc="owner", default="root") -option_25 = StrOption(name="source", doc="source", default="file2") -option_26 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) -option_18 = OptionDescription(name="file2", doc="file2", children=[option_19, option_20, option_21, option_22, option_23, option_24, option_25, option_26]) -option_8 = OptionDescription(name="files", doc="files", children=[option_9, option_18]) -option_27 = BoolOption(name="activate", doc="activate", default=True) -option_28 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_27, option_28]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +option_9 = OptionDescription(name="file1", doc="file1", children=[option_10, option_11]) +option_9.impl_set_information('source', "file1") +option_13 = FilenameOption(name="name", doc="name", default="/tmp/file2") +option_14 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("oui")}))) +option_12 = OptionDescription(name="file2", doc="file2", children=[option_13, option_14]) +option_12.impl_set_information('source', "file2") +option_8 = OptionDescription(name="files", doc="files", children=[option_9, option_12]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_15, option_16]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/11disabledifin_filelist_notexist/makedict/after.json b/tests/dictionaries/11disabledifin_filelist_notexist/makedict/after.json index f350e51c..7017b8a5 100644 --- a/tests/dictionaries/11disabledifin_filelist_notexist/makedict/after.json +++ b/tests/dictionaries/11disabledifin_filelist_notexist/makedict/after.json @@ -11,34 +11,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/tmp/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabledifin_filelist_notexist/makedict/base.json b/tests/dictionaries/11disabledifin_filelist_notexist/makedict/base.json index cf42ee84..23361c53 100644 --- a/tests/dictionaries/11disabledifin_filelist_notexist/makedict/base.json +++ b/tests/dictionaries/11disabledifin_filelist_notexist/makedict/base.json @@ -2,13 +2,7 @@ "rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/tmp/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": false, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/11disabledifin_filelist_notexist/makedict/before.json b/tests/dictionaries/11disabledifin_filelist_notexist/makedict/before.json index f350e51c..7017b8a5 100644 --- a/tests/dictionaries/11disabledifin_filelist_notexist/makedict/before.json +++ b/tests/dictionaries/11disabledifin_filelist_notexist/makedict/before.json @@ -11,34 +11,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/tmp/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py b/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py index 158e1708..9ad073d5 100644 --- a/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py +++ b/tests/dictionaries/11disabledifin_filelist_notexist/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non" option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) +option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) +option_9.impl_set_information('source', "file") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/after.json b/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/after.json index f350e51c..7017b8a5 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/after.json +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/after.json @@ -11,34 +11,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/tmp/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/base.json b/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/base.json index cf42ee84..23361c53 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/base.json +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/base.json @@ -2,13 +2,7 @@ "rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/tmp/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": false, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/before.json b/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/before.json index f350e51c..7017b8a5 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/before.json +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist/makedict/before.json @@ -11,34 +11,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/tmp/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py b/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py index 158e1708..9ad073d5 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non" option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True)}))) +option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) +option_9.impl_set_information('source', "file") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/after.json b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/after.json index f350e51c..7017b8a5 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/after.json +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/after.json @@ -11,34 +11,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/tmp/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/base.json b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/base.json index cf42ee84..23361c53 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/base.json +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/base.json @@ -2,13 +2,7 @@ "rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/tmp/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": false, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/before.json b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/before.json index f350e51c..7017b8a5 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/before.json +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/makedict/before.json @@ -11,34 +11,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/tmp/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py index db0d3b12..c0147a22 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_multi/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non" option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True), 'condition_1': ParamOption(option_5, notraisepropertyerror=True), 'expected_1': ParamValue("oui"), 'reverse_condition_1': ParamValue(True), 'condition_operator': ParamValue("OR")}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True), 'condition_1': ParamOption(option_5, notraisepropertyerror=True), 'expected_1': ParamValue("oui"), 'reverse_condition_1': ParamValue(True), 'condition_operator': ParamValue("OR")}))) +option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) +option_9.impl_set_information('source', "file") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/after.json b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/after.json index f350e51c..7017b8a5 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/after.json +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/after.json @@ -11,34 +11,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/tmp/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/base.json b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/base.json index cf42ee84..23361c53 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/base.json +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/base.json @@ -2,13 +2,7 @@ "rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/tmp/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": false, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/before.json b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/before.json index f350e51c..7017b8a5 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/before.json +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/makedict/before.json @@ -11,34 +11,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/tmp/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py index 9bdaaa29..324f9d58 100644 --- a/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py +++ b/tests/dictionaries/11disabledifnotin_filelist_notexist_validenum/tiramisu/base.py @@ -16,18 +16,13 @@ option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non" option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_10 = StrOption(name="engine", doc="engine", default="creole") -option_11 = StrOption(name="group", doc="group", default="root") -option_12 = StrOption(name="included", doc="included", default="no") -option_13 = StrOption(name="mode", doc="mode", default="0644") -option_14 = FilenameOption(name="name", doc="name", default="/tmp/file") -option_15 = StrOption(name="owner", doc="owner", default="root") -option_16 = StrOption(name="source", doc="source", default="file") -option_17 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("statique"), 'reverse_condition_0': ParamValue(True)}))) -option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) +option_10 = FilenameOption(name="name", doc="name", default="/tmp/file") +option_11 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3, notraisepropertyerror=True), 'expected_0': ParamValue("statique"), 'reverse_condition_0': ParamValue(True)}))) +option_9 = OptionDescription(name="file", doc="file", children=[option_10, option_11]) +option_9.impl_set_information('source', "file") option_8 = OptionDescription(name="files", doc="files", children=[option_9]) -option_18 = BoolOption(name="activate", doc="activate", default=True) -option_19 = BoolOption(name="manage", doc="manage", default=True) -option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_18, option_19]) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_13 = BoolOption(name="manage", doc="manage", default=True) +option_7 = OptionDescription(name="test", doc="test", children=[option_8, option_12, option_13]) option_6 = OptionDescription(name="services", doc="services", children=[option_7], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_6]) diff --git a/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/after.json b/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/after.json index 48c91619..e578b184 100644 --- a/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/after.json +++ b/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/after.json @@ -7,34 +7,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/base.json b/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/base.json index 1e05ae49..4c33e3d9 100644 --- a/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/base.json +++ b/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/base.json @@ -1,13 +1,7 @@ { "rougail.general.mode_conteneur_actif": "non", "rougail.general.condition": "non", - "services.test.files.file1.engine": "creole", - "services.test.files.file1.group": "root", - "services.test.files.file1.included": "no", - "services.test.files.file1.mode": "0644", "services.test.files.file1.name": "/tmp/file1", - "services.test.files.file1.owner": "root", - "services.test.files.file1.source": "file1", "services.test.files.file1.activate": false, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/before.json b/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/before.json index 48c91619..e578b184 100644 --- a/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/before.json +++ b/tests/dictionaries/11multi_disabled_if_in_filelist/makedict/before.json @@ -7,34 +7,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file1.name": { "owner": "default", "value": "/tmp/file1" }, - "services.test.files.file1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file1.source": { - "owner": "default", - "value": "file1" - }, "services.test.files.file1.activate": { "owner": "default", "value": false diff --git a/tests/dictionaries/11multi_disabled_if_in_filelist/tiramisu/base.py b/tests/dictionaries/11multi_disabled_if_in_filelist/tiramisu/base.py index 4e1e374d..c8784fa0 100644 --- a/tests/dictionaries/11multi_disabled_if_in_filelist/tiramisu/base.py +++ b/tests/dictionaries/11multi_disabled_if_in_filelist/tiramisu/base.py @@ -15,18 +15,13 @@ option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non" option_4 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_9 = StrOption(name="engine", doc="engine", default="creole") -option_10 = StrOption(name="group", doc="group", default="root") -option_11 = StrOption(name="included", doc="included", default="no") -option_12 = StrOption(name="mode", doc="mode", default="0644") -option_13 = FilenameOption(name="name", doc="name", default="/tmp/file1") -option_14 = StrOption(name="owner", doc="owner", default="root") -option_15 = StrOption(name="source", doc="source", default="file1") -option_16 = BoolOption(name="activate", doc="activate", default=False) -option_8 = OptionDescription(name="file1", doc="file1", children=[option_9, option_10, option_11, option_12, option_13, option_14, option_15, option_16]) +option_9 = FilenameOption(name="name", doc="name", default="/tmp/file1") +option_10 = BoolOption(name="activate", doc="activate", default=False) +option_8 = OptionDescription(name="file1", doc="file1", children=[option_9, option_10]) +option_8.impl_set_information('source', "file1") option_7 = OptionDescription(name="files", doc="files", children=[option_8]) -option_17 = BoolOption(name="activate", doc="activate", default=True) -option_18 = BoolOption(name="manage", doc="manage", default=True) -option_6 = OptionDescription(name="test", doc="test", children=[option_7, option_17, option_18]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_12 = BoolOption(name="manage", doc="manage", default=True) +option_6 = OptionDescription(name="test", doc="test", children=[option_7, option_11, option_12]) option_5 = OptionDescription(name="services", doc="services", children=[option_6], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) diff --git a/tests/dictionaries/20notemplating/makedict/after.json b/tests/dictionaries/20notemplating/makedict/after.json index d10c0591..406d96f0 100644 --- a/tests/dictionaries/20notemplating/makedict/after.json +++ b/tests/dictionaries/20notemplating/makedict/after.json @@ -3,34 +3,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "none" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/20notemplating/makedict/base.json b/tests/dictionaries/20notemplating/makedict/base.json index 52a445f3..a1e4c0db 100644 --- a/tests/dictionaries/20notemplating/makedict/base.json +++ b/tests/dictionaries/20notemplating/makedict/base.json @@ -1,12 +1,6 @@ { "rougail.general.mode_conteneur_actif": "non", - "services.test.files.file.engine": "none", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/20notemplating/makedict/before.json b/tests/dictionaries/20notemplating/makedict/before.json index d10c0591..406d96f0 100644 --- a/tests/dictionaries/20notemplating/makedict/before.json +++ b/tests/dictionaries/20notemplating/makedict/before.json @@ -3,34 +3,10 @@ "owner": "default", "value": "non" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "none" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/20notemplating/tiramisu/base.py b/tests/dictionaries/20notemplating/tiramisu/base.py index 615ba96a..e0c9c14f 100644 --- a/tests/dictionaries/20notemplating/tiramisu/base.py +++ b/tests/dictionaries/20notemplating/tiramisu/base.py @@ -14,18 +14,14 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="none") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/file") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="file") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) +option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) +option_7.impl_set_information('engine', "none") +option_7.impl_set_information('source', "file") option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_17 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17]) +option_10 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_10, option_11]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/20override/makedict/after.json b/tests/dictionaries/20override/makedict/after.json index ea225939..a80dd37d 100644 --- a/tests/dictionaries/20override/makedict/after.json +++ b/tests/dictionaries/20override/makedict/after.json @@ -3,18 +3,6 @@ "owner": "default", "value": "non" }, - "services.test.overrides.test_service.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.overrides.test_service.name": { - "owner": "default", - "value": "test" - }, - "services.test.overrides.test_service.source": { - "owner": "default", - "value": "test.service" - }, "services.test.overrides.test_service.activate": { "owner": "default", "value": true @@ -27,18 +15,6 @@ "owner": "default", "value": true }, - "services.test2.overrides.test2_service.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test2.overrides.test2_service.name": { - "owner": "default", - "value": "test2" - }, - "services.test2.overrides.test2_service.source": { - "owner": "default", - "value": "test2.service" - }, "services.test2.overrides.test2_service.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/20override/makedict/base.json b/tests/dictionaries/20override/makedict/base.json index df29ea4a..2de81c42 100644 --- a/tests/dictionaries/20override/makedict/base.json +++ b/tests/dictionaries/20override/makedict/base.json @@ -1,14 +1,8 @@ { "rougail.general.mode_conteneur_actif": "non", - "services.test.overrides.test_service.engine": "creole", - "services.test.overrides.test_service.name": "test", - "services.test.overrides.test_service.source": "test.service", "services.test.overrides.test_service.activate": true, "services.test.activate": true, "services.test.manage": true, - "services.test2.overrides.test2_service.engine": "jinja2", - "services.test2.overrides.test2_service.name": "test2", - "services.test2.overrides.test2_service.source": "test2.service", "services.test2.overrides.test2_service.activate": true, "services.test2.activate": true, "services.test2.manage": true diff --git a/tests/dictionaries/20override/makedict/before.json b/tests/dictionaries/20override/makedict/before.json index ea225939..a80dd37d 100644 --- a/tests/dictionaries/20override/makedict/before.json +++ b/tests/dictionaries/20override/makedict/before.json @@ -3,18 +3,6 @@ "owner": "default", "value": "non" }, - "services.test.overrides.test_service.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.overrides.test_service.name": { - "owner": "default", - "value": "test" - }, - "services.test.overrides.test_service.source": { - "owner": "default", - "value": "test.service" - }, "services.test.overrides.test_service.activate": { "owner": "default", "value": true @@ -27,18 +15,6 @@ "owner": "default", "value": true }, - "services.test2.overrides.test2_service.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test2.overrides.test2_service.name": { - "owner": "default", - "value": "test2" - }, - "services.test2.overrides.test2_service.source": { - "owner": "default", - "value": "test2.service" - }, "services.test2.overrides.test2_service.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/20override/tiramisu/base.py b/tests/dictionaries/20override/tiramisu/base.py index c0bae6a5..81d62f49 100644 --- a/tests/dictionaries/20override/tiramisu/base.py +++ b/tests/dictionaries/20override/tiramisu/base.py @@ -14,23 +14,22 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="name", doc="name", default="test") -option_10 = StrOption(name="source", doc="source", default="test.service") -option_11 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_9, option_10, option_11]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8]) +option_7.impl_set_information('name', "test") +option_7.impl_set_information('source', "test.service") option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_12, option_13]) -option_17 = StrOption(name="engine", doc="engine", default="jinja2") -option_18 = StrOption(name="name", doc="name", default="test2") -option_19 = StrOption(name="source", doc="source", default="test2.service") -option_20 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="test2_service", doc="test2.service", children=[option_17, option_18, option_19, option_20]) -option_15 = OptionDescription(name="overrides", doc="overrides", children=[option_16]) -option_21 = BoolOption(name="activate", doc="activate", default=True) -option_22 = BoolOption(name="manage", doc="manage", default=True) -option_14 = OptionDescription(name="test2", doc="test2", children=[option_15, option_21, option_22]) -option_4 = OptionDescription(name="services", doc="services", children=[option_5, option_14], properties=frozenset({"hidden"})) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_9, option_10]) +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_13 = OptionDescription(name="test2_service", doc="test2.service", children=[option_14]) +option_13.impl_set_information('engine', "jinja2") +option_13.impl_set_information('name', "test2") +option_13.impl_set_information('source', "test2.service") +option_12 = OptionDescription(name="overrides", doc="overrides", children=[option_13]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +option_11 = OptionDescription(name="test2", doc="test2", children=[option_12, option_15, option_16]) +option_4 = OptionDescription(name="services", doc="services", children=[option_5, option_11], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/20override_no_templating/makedict/after.json b/tests/dictionaries/20override_no_templating/makedict/after.json index 07d00ab9..b76fd3d1 100644 --- a/tests/dictionaries/20override_no_templating/makedict/after.json +++ b/tests/dictionaries/20override_no_templating/makedict/after.json @@ -3,18 +3,6 @@ "owner": "default", "value": "non" }, - "services.test.overrides.test_service.engine": { - "owner": "default", - "value": "none" - }, - "services.test.overrides.test_service.name": { - "owner": "default", - "value": "test" - }, - "services.test.overrides.test_service.source": { - "owner": "default", - "value": "test.service" - }, "services.test.overrides.test_service.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/20override_no_templating/makedict/base.json b/tests/dictionaries/20override_no_templating/makedict/base.json index 82581028..9dc9b73a 100644 --- a/tests/dictionaries/20override_no_templating/makedict/base.json +++ b/tests/dictionaries/20override_no_templating/makedict/base.json @@ -1,8 +1,5 @@ { "rougail.general.mode_conteneur_actif": "non", - "services.test.overrides.test_service.engine": "none", - "services.test.overrides.test_service.name": "test", - "services.test.overrides.test_service.source": "test.service", "services.test.overrides.test_service.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/20override_no_templating/makedict/before.json b/tests/dictionaries/20override_no_templating/makedict/before.json index 07d00ab9..b76fd3d1 100644 --- a/tests/dictionaries/20override_no_templating/makedict/before.json +++ b/tests/dictionaries/20override_no_templating/makedict/before.json @@ -3,18 +3,6 @@ "owner": "default", "value": "non" }, - "services.test.overrides.test_service.engine": { - "owner": "default", - "value": "none" - }, - "services.test.overrides.test_service.name": { - "owner": "default", - "value": "test" - }, - "services.test.overrides.test_service.source": { - "owner": "default", - "value": "test.service" - }, "services.test.overrides.test_service.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/20override_no_templating/tiramisu/base.py b/tests/dictionaries/20override_no_templating/tiramisu/base.py index 3de45df9..40ea916b 100644 --- a/tests/dictionaries/20override_no_templating/tiramisu/base.py +++ b/tests/dictionaries/20override_no_templating/tiramisu/base.py @@ -14,14 +14,14 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="none") -option_9 = StrOption(name="name", doc="name", default="test") -option_10 = StrOption(name="source", doc="source", default="test.service") -option_11 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8, option_9, option_10, option_11]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="test_service", doc="test.service", children=[option_8]) +option_7.impl_set_information('engine', "none") +option_7.impl_set_information('name', "test") +option_7.impl_set_information('source', "test.service") option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_12, option_13]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_9, option_10]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/20override_source/makedict/after.json b/tests/dictionaries/20override_source/makedict/after.json index dbc42c12..60992c7f 100644 --- a/tests/dictionaries/20override_source/makedict/after.json +++ b/tests/dictionaries/20override_source/makedict/after.json @@ -3,18 +3,6 @@ "owner": "default", "value": "non" }, - "services.test.overrides.test2_service.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.overrides.test2_service.name": { - "owner": "default", - "value": "test" - }, - "services.test.overrides.test2_service.source": { - "owner": "default", - "value": "test2.service" - }, "services.test.overrides.test2_service.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/20override_source/makedict/base.json b/tests/dictionaries/20override_source/makedict/base.json index 0856e35c..3c86a824 100644 --- a/tests/dictionaries/20override_source/makedict/base.json +++ b/tests/dictionaries/20override_source/makedict/base.json @@ -1,8 +1,5 @@ { "rougail.general.mode_conteneur_actif": "non", - "services.test.overrides.test2_service.engine": "creole", - "services.test.overrides.test2_service.name": "test", - "services.test.overrides.test2_service.source": "test2.service", "services.test.overrides.test2_service.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/20override_source/makedict/before.json b/tests/dictionaries/20override_source/makedict/before.json index dbc42c12..60992c7f 100644 --- a/tests/dictionaries/20override_source/makedict/before.json +++ b/tests/dictionaries/20override_source/makedict/before.json @@ -3,18 +3,6 @@ "owner": "default", "value": "non" }, - "services.test.overrides.test2_service.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.overrides.test2_service.name": { - "owner": "default", - "value": "test" - }, - "services.test.overrides.test2_service.source": { - "owner": "default", - "value": "test2.service" - }, "services.test.overrides.test2_service.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/20override_source/tiramisu/base.py b/tests/dictionaries/20override_source/tiramisu/base.py index 4e7dcc66..ab1df588 100644 --- a/tests/dictionaries/20override_source/tiramisu/base.py +++ b/tests/dictionaries/20override_source/tiramisu/base.py @@ -14,14 +14,13 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="name", doc="name", default="test") -option_10 = StrOption(name="source", doc="source", default="test2.service") -option_11 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="test2_service", doc="test2.service", children=[option_8, option_9, option_10, option_11]) +option_8 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="test2_service", doc="test2.service", children=[option_8]) +option_7.impl_set_information('name', "test") +option_7.impl_set_information('source', "test2.service") option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7]) -option_12 = BoolOption(name="activate", doc="activate", default=True) -option_13 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_12, option_13]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_9, option_10]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/40ifin_leadershipauto/makedict/after.json b/tests/dictionaries/40ifin_leadershipauto/makedict/after.json index 06fbbb59..3cde1013 100644 --- a/tests/dictionaries/40ifin_leadershipauto/makedict/after.json +++ b/tests/dictionaries/40ifin_leadershipauto/makedict/after.json @@ -21,34 +21,10 @@ null ] }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/40ifin_leadershipauto/makedict/base.json b/tests/dictionaries/40ifin_leadershipauto/makedict/base.json index abb03d5a..364a2fa9 100644 --- a/tests/dictionaries/40ifin_leadershipauto/makedict/base.json +++ b/tests/dictionaries/40ifin_leadershipauto/makedict/base.json @@ -7,13 +7,7 @@ "rougail.general.leader.follower2": null } ], - "services.test.files.mailname.engine": "creole", - "services.test.files.mailname.group": "root", - "services.test.files.mailname.included": "no", - "services.test.files.mailname.mode": "0644", "services.test.files.mailname.name": "/etc/mailname", - "services.test.files.mailname.owner": "root", - "services.test.files.mailname.source": "mailname", "services.test.files.mailname.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/40ifin_leadershipauto/makedict/before.json b/tests/dictionaries/40ifin_leadershipauto/makedict/before.json index 06fbbb59..3cde1013 100644 --- a/tests/dictionaries/40ifin_leadershipauto/makedict/before.json +++ b/tests/dictionaries/40ifin_leadershipauto/makedict/before.json @@ -21,34 +21,10 @@ null ] }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py b/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py index 7dd16c28..22ba6b9c 100644 --- a/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py +++ b/tests/dictionaries/40ifin_leadershipauto/tiramisu/base.py @@ -19,18 +19,13 @@ option_8 = StrOption(name="follower2", doc="follower2", multi=True, properties=f option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_13 = StrOption(name="engine", doc="engine", default="creole") -option_14 = StrOption(name="group", doc="group", default="root") -option_15 = StrOption(name="included", doc="included", default="no") -option_16 = StrOption(name="mode", doc="mode", default="0644") -option_17 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_18 = StrOption(name="owner", doc="owner", default="root") -option_19 = StrOption(name="source", doc="source", default="mailname") -option_20 = BoolOption(name="activate", doc="activate", default=True) -option_12 = OptionDescription(name="mailname", doc="mailname", children=[option_13, option_14, option_15, option_16, option_17, option_18, option_19, option_20]) +option_13 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_12 = OptionDescription(name="mailname", doc="mailname", children=[option_13, option_14]) +option_12.impl_set_information('source', "mailname") option_11 = OptionDescription(name="files", doc="files", children=[option_12]) -option_21 = BoolOption(name="activate", doc="activate", default=True) -option_22 = BoolOption(name="manage", doc="manage", default=True) -option_10 = OptionDescription(name="test", doc="test", children=[option_11, option_21, option_22]) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_16 = BoolOption(name="manage", doc="manage", default=True) +option_10 = OptionDescription(name="test", doc="test", children=[option_11, option_15, option_16]) option_9 = OptionDescription(name="services", doc="services", children=[option_10], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_9]) diff --git a/tests/dictionaries/40ifin_leadershipauto_follower/makedict/after.json b/tests/dictionaries/40ifin_leadershipauto_follower/makedict/after.json index d2092a9a..c78d6ab1 100644 --- a/tests/dictionaries/40ifin_leadershipauto_follower/makedict/after.json +++ b/tests/dictionaries/40ifin_leadershipauto_follower/makedict/after.json @@ -34,66 +34,18 @@ null ] }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.mailname2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.mailname2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname2.name": { "owner": "default", "value": "/etc/mailname2" }, - "services.test.files.mailname2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.source": { - "owner": "default", - "value": "mailname2" - }, "services.test.files.mailname2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/40ifin_leadershipauto_follower/makedict/base.json b/tests/dictionaries/40ifin_leadershipauto_follower/makedict/base.json index df5efe3b..28acc53e 100644 --- a/tests/dictionaries/40ifin_leadershipauto_follower/makedict/base.json +++ b/tests/dictionaries/40ifin_leadershipauto_follower/makedict/base.json @@ -12,21 +12,9 @@ "rougail.general.leader.follower2": null } ], - "services.test.files.mailname.engine": "creole", - "services.test.files.mailname.group": "root", - "services.test.files.mailname.included": "no", - "services.test.files.mailname.mode": "0644", "services.test.files.mailname.name": "/etc/mailname", - "services.test.files.mailname.owner": "root", - "services.test.files.mailname.source": "mailname", "services.test.files.mailname.activate": true, - "services.test.files.mailname2.engine": "jinja2", - "services.test.files.mailname2.group": "root", - "services.test.files.mailname2.included": "no", - "services.test.files.mailname2.mode": "0644", "services.test.files.mailname2.name": "/etc/mailname2", - "services.test.files.mailname2.owner": "root", - "services.test.files.mailname2.source": "mailname2", "services.test.files.mailname2.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/40ifin_leadershipauto_follower/makedict/before.json b/tests/dictionaries/40ifin_leadershipauto_follower/makedict/before.json index d2092a9a..c78d6ab1 100644 --- a/tests/dictionaries/40ifin_leadershipauto_follower/makedict/before.json +++ b/tests/dictionaries/40ifin_leadershipauto_follower/makedict/before.json @@ -34,66 +34,18 @@ null ] }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.mailname2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.mailname2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname2.name": { "owner": "default", "value": "/etc/mailname2" }, - "services.test.files.mailname2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.source": { - "owner": "default", - "value": "mailname2" - }, "services.test.files.mailname2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py b/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py index a9db138d..751a0d06 100644 --- a/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py +++ b/tests/dictionaries/40ifin_leadershipauto_follower/tiramisu/base.py @@ -19,27 +19,18 @@ option_8 = StrOption(name="follower2", doc="follower2", multi=True, properties=f option_5 = Leadership(name="leader", doc="leader", children=[option_6, option_7, option_8], properties=frozenset({"normal"})) option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4, option_5], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_13 = StrOption(name="engine", doc="engine", default="creole") -option_14 = StrOption(name="group", doc="group", default="root") -option_15 = StrOption(name="included", doc="included", default="no") -option_16 = StrOption(name="mode", doc="mode", default="0644") -option_17 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_18 = StrOption(name="owner", doc="owner", default="root") -option_19 = StrOption(name="source", doc="source", default="mailname") -option_20 = BoolOption(name="activate", doc="activate", default=True) -option_12 = OptionDescription(name="mailname", doc="mailname", children=[option_13, option_14, option_15, option_16, option_17, option_18, option_19, option_20]) -option_22 = StrOption(name="engine", doc="engine", default="jinja2") -option_23 = StrOption(name="group", doc="group", default="root") -option_24 = StrOption(name="included", doc="included", default="no") -option_25 = StrOption(name="mode", doc="mode", default="0644") -option_26 = FilenameOption(name="name", doc="name", default="/etc/mailname2") -option_27 = StrOption(name="owner", doc="owner", default="root") -option_28 = StrOption(name="source", doc="source", default="mailname2") -option_29 = BoolOption(name="activate", doc="activate", default=True) -option_21 = OptionDescription(name="mailname2", doc="mailname2", children=[option_22, option_23, option_24, option_25, option_26, option_27, option_28, option_29]) -option_11 = OptionDescription(name="files", doc="files", children=[option_12, option_21]) -option_30 = BoolOption(name="activate", doc="activate", default=True) -option_31 = BoolOption(name="manage", doc="manage", default=True) -option_10 = OptionDescription(name="test", doc="test", children=[option_11, option_30, option_31]) +option_13 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_14 = BoolOption(name="activate", doc="activate", default=True) +option_12 = OptionDescription(name="mailname", doc="mailname", children=[option_13, option_14]) +option_12.impl_set_information('source', "mailname") +option_16 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_17 = BoolOption(name="activate", doc="activate", default=True) +option_15 = OptionDescription(name="mailname2", doc="mailname2", children=[option_16, option_17]) +option_15.impl_set_information('engine', "jinja2") +option_15.impl_set_information('source', "mailname2") +option_11 = OptionDescription(name="files", doc="files", children=[option_12, option_15]) +option_18 = BoolOption(name="activate", doc="activate", default=True) +option_19 = BoolOption(name="manage", doc="manage", default=True) +option_10 = OptionDescription(name="test", doc="test", children=[option_11, option_18, option_19]) option_9 = OptionDescription(name="services", doc="services", children=[option_10], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_9]) diff --git a/tests/dictionaries/45extra_without_family/makedict/after.json b/tests/dictionaries/45extra_without_family/makedict/after.json index 6bfe0036..648d84a6 100644 --- a/tests/dictionaries/45extra_without_family/makedict/after.json +++ b/tests/dictionaries/45extra_without_family/makedict/after.json @@ -7,34 +7,10 @@ "owner": "default", "value": null }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/45extra_without_family/makedict/base.json b/tests/dictionaries/45extra_without_family/makedict/base.json index 632cddc9..645b9a2d 100644 --- a/tests/dictionaries/45extra_without_family/makedict/base.json +++ b/tests/dictionaries/45extra_without_family/makedict/base.json @@ -1,13 +1,7 @@ { "rougail.my_var": "rougail", "extra.my_var": null, - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/45extra_without_family/makedict/before.json b/tests/dictionaries/45extra_without_family/makedict/before.json index 6bfe0036..648d84a6 100644 --- a/tests/dictionaries/45extra_without_family/makedict/before.json +++ b/tests/dictionaries/45extra_without_family/makedict/before.json @@ -7,34 +7,10 @@ "owner": "default", "value": null }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/45extra_without_family/tiramisu/base.py b/tests/dictionaries/45extra_without_family/tiramisu/base.py index 92eaec88..36724493 100644 --- a/tests/dictionaries/45extra_without_family/tiramisu/base.py +++ b/tests/dictionaries/45extra_without_family/tiramisu/base.py @@ -15,18 +15,13 @@ option_2 = StrOption(name="my_var", doc="my_var", default="rougail", properties= option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) option_4 = StrOption(name="my_var", doc="my_var", default=Calculation(func.calc_multi_condition, Params((ParamValue("non")))), properties=frozenset({"normal"})) option_3 = OptionDescription(name="extra", doc="extra", children=[option_4]) -option_9 = StrOption(name="engine", doc="engine", default="creole") -option_10 = StrOption(name="group", doc="group", default="root") -option_11 = StrOption(name="included", doc="included", default="no") -option_12 = StrOption(name="mode", doc="mode", default="0644") -option_13 = FilenameOption(name="name", doc="name", default="/etc/file") -option_14 = StrOption(name="owner", doc="owner", default="root") -option_15 = StrOption(name="source", doc="source", default="file") -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_8 = OptionDescription(name="file", doc="file", children=[option_9, option_10, option_11, option_12, option_13, option_14, option_15, option_16]) +option_9 = FilenameOption(name="name", doc="name", default="/etc/file") +option_10 = BoolOption(name="activate", doc="activate", default=True) +option_8 = OptionDescription(name="file", doc="file", children=[option_9, option_10]) +option_8.impl_set_information('source', "file") option_7 = OptionDescription(name="files", doc="files", children=[option_8]) -option_17 = BoolOption(name="activate", doc="activate", default=True) -option_18 = BoolOption(name="manage", doc="manage", default=True) -option_6 = OptionDescription(name="test", doc="test", children=[option_7, option_17, option_18]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_12 = BoolOption(name="manage", doc="manage", default=True) +option_6 = OptionDescription(name="test", doc="test", children=[option_7, option_11, option_12]) option_5 = OptionDescription(name="services", doc="services", children=[option_6], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3, option_5]) diff --git a/tests/dictionaries/60extra_group/makedict/after.json b/tests/dictionaries/60extra_group/makedict/after.json index 9aa0c6bf..0295b3e4 100644 --- a/tests/dictionaries/60extra_group/makedict/after.json +++ b/tests/dictionaries/60extra_group/makedict/after.json @@ -21,66 +21,18 @@ "pre" ] }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.mailname2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.mailname2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname2.name": { "owner": "default", "value": "/etc/mailname2" }, - "services.test.files.mailname2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.source": { - "owner": "default", - "value": "mailname2" - }, "services.test.files.mailname2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/60extra_group/makedict/base.json b/tests/dictionaries/60extra_group/makedict/base.json index 43604c9f..b67b1029 100644 --- a/tests/dictionaries/60extra_group/makedict/base.json +++ b/tests/dictionaries/60extra_group/makedict/base.json @@ -7,21 +7,9 @@ "extra.ejabberd.description.mode": "pre" } ], - "services.test.files.mailname.engine": "creole", - "services.test.files.mailname.group": "root", - "services.test.files.mailname.included": "no", - "services.test.files.mailname.mode": "0644", "services.test.files.mailname.name": "/etc/mailname", - "services.test.files.mailname.owner": "root", - "services.test.files.mailname.source": "mailname", "services.test.files.mailname.activate": true, - "services.test.files.mailname2.engine": "jinja2", - "services.test.files.mailname2.group": "root", - "services.test.files.mailname2.included": "no", - "services.test.files.mailname2.mode": "0644", "services.test.files.mailname2.name": "/etc/mailname2", - "services.test.files.mailname2.owner": "root", - "services.test.files.mailname2.source": "mailname2", "services.test.files.mailname2.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/60extra_group/makedict/before.json b/tests/dictionaries/60extra_group/makedict/before.json index 9aa0c6bf..0295b3e4 100644 --- a/tests/dictionaries/60extra_group/makedict/before.json +++ b/tests/dictionaries/60extra_group/makedict/before.json @@ -21,66 +21,18 @@ "pre" ] }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.mailname2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.mailname2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname2.name": { "owner": "default", "value": "/etc/mailname2" }, - "services.test.files.mailname2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.source": { - "owner": "default", - "value": "mailname2" - }, "services.test.files.mailname2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/60extra_group/tiramisu/base.py b/tests/dictionaries/60extra_group/tiramisu/base.py index 48bbaf6a..b306fe56 100644 --- a/tests/dictionaries/60extra_group/tiramisu/base.py +++ b/tests/dictionaries/60extra_group/tiramisu/base.py @@ -20,27 +20,18 @@ option_9 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", p option_7 = Leadership(name="description", doc="description", children=[option_8, option_9], properties=frozenset({"normal"})) option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7], properties=frozenset({"normal"})) option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_14 = StrOption(name="engine", doc="engine", default="creole") -option_15 = StrOption(name="group", doc="group", default="root") -option_16 = StrOption(name="included", doc="included", default="no") -option_17 = StrOption(name="mode", doc="mode", default="0644") -option_18 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_19 = StrOption(name="owner", doc="owner", default="root") -option_20 = StrOption(name="source", doc="source", default="mailname") -option_21 = BoolOption(name="activate", doc="activate", default=True) -option_13 = OptionDescription(name="mailname", doc="mailname", children=[option_14, option_15, option_16, option_17, option_18, option_19, option_20, option_21]) -option_23 = StrOption(name="engine", doc="engine", default="jinja2") -option_24 = StrOption(name="group", doc="group", default="root") -option_25 = StrOption(name="included", doc="included", default="no") -option_26 = StrOption(name="mode", doc="mode", default="0644") -option_27 = FilenameOption(name="name", doc="name", default="/etc/mailname2") -option_28 = StrOption(name="owner", doc="owner", default="root") -option_29 = StrOption(name="source", doc="source", default="mailname2") -option_30 = BoolOption(name="activate", doc="activate", default=True) -option_22 = OptionDescription(name="mailname2", doc="mailname2", children=[option_23, option_24, option_25, option_26, option_27, option_28, option_29, option_30]) -option_12 = OptionDescription(name="files", doc="files", children=[option_13, option_22]) -option_31 = BoolOption(name="activate", doc="activate", default=True) -option_32 = BoolOption(name="manage", doc="manage", default=True) -option_11 = OptionDescription(name="test", doc="test", children=[option_12, option_31, option_32]) +option_14 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_13 = OptionDescription(name="mailname", doc="mailname", children=[option_14, option_15]) +option_13.impl_set_information('source', "mailname") +option_17 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_18 = BoolOption(name="activate", doc="activate", default=True) +option_16 = OptionDescription(name="mailname2", doc="mailname2", children=[option_17, option_18]) +option_16.impl_set_information('engine', "jinja2") +option_16.impl_set_information('source', "mailname2") +option_12 = OptionDescription(name="files", doc="files", children=[option_13, option_16]) +option_19 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +option_11 = OptionDescription(name="test", doc="test", children=[option_12, option_19, option_20]) option_10 = OptionDescription(name="services", doc="services", children=[option_11], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5, option_10]) diff --git a/tests/dictionaries/60extra_help/makedict/after.json b/tests/dictionaries/60extra_help/makedict/after.json index 5b40c269..6cf540ce 100644 --- a/tests/dictionaries/60extra_help/makedict/after.json +++ b/tests/dictionaries/60extra_help/makedict/after.json @@ -19,34 +19,10 @@ "owner": "default", "value": "pre" }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/60extra_help/makedict/base.json b/tests/dictionaries/60extra_help/makedict/base.json index 9b605156..37a6c4d4 100644 --- a/tests/dictionaries/60extra_help/makedict/base.json +++ b/tests/dictionaries/60extra_help/makedict/base.json @@ -4,13 +4,7 @@ "extra.ejabberd.description": "Exportation de la base de ejabberd", "extra.ejabberd.day": null, "extra.ejabberd.mode": "pre", - "services.test.files.mailname.engine": "creole", - "services.test.files.mailname.group": "root", - "services.test.files.mailname.included": "no", - "services.test.files.mailname.mode": "0644", "services.test.files.mailname.name": "/etc/mailname", - "services.test.files.mailname.owner": "root", - "services.test.files.mailname.source": "mailname", "services.test.files.mailname.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/60extra_help/makedict/before.json b/tests/dictionaries/60extra_help/makedict/before.json index 5b40c269..6cf540ce 100644 --- a/tests/dictionaries/60extra_help/makedict/before.json +++ b/tests/dictionaries/60extra_help/makedict/before.json @@ -19,34 +19,10 @@ "owner": "default", "value": "pre" }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/60extra_help/tiramisu/base.py b/tests/dictionaries/60extra_help/tiramisu/base.py index fe6f95c3..7b861b23 100644 --- a/tests/dictionaries/60extra_help/tiramisu/base.py +++ b/tests/dictionaries/60extra_help/tiramisu/base.py @@ -21,18 +21,13 @@ option_8.impl_set_information('help', "Test help") option_9 = ChoiceOption(name="mode", doc="mode", values=('pre', 'post'), default="pre", properties=frozenset({"mandatory", "normal"})) option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7, option_8, option_9], properties=frozenset({"normal"})) option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) -option_14 = StrOption(name="engine", doc="engine", default="creole") -option_15 = StrOption(name="group", doc="group", default="root") -option_16 = StrOption(name="included", doc="included", default="no") -option_17 = StrOption(name="mode", doc="mode", default="0644") -option_18 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_19 = StrOption(name="owner", doc="owner", default="root") -option_20 = StrOption(name="source", doc="source", default="mailname") -option_21 = BoolOption(name="activate", doc="activate", default=True) -option_13 = OptionDescription(name="mailname", doc="mailname", children=[option_14, option_15, option_16, option_17, option_18, option_19, option_20, option_21]) +option_14 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_13 = OptionDescription(name="mailname", doc="mailname", children=[option_14, option_15]) +option_13.impl_set_information('source', "mailname") option_12 = OptionDescription(name="files", doc="files", children=[option_13]) -option_22 = BoolOption(name="activate", doc="activate", default=True) -option_23 = BoolOption(name="manage", doc="manage", default=True) -option_11 = OptionDescription(name="test", doc="test", children=[option_12, option_22, option_23]) +option_16 = BoolOption(name="activate", doc="activate", default=True) +option_17 = BoolOption(name="manage", doc="manage", default=True) +option_11 = OptionDescription(name="test", doc="test", children=[option_12, option_16, option_17]) option_10 = OptionDescription(name="services", doc="services", children=[option_11], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5, option_10]) diff --git a/tests/dictionaries/70container_files/makedict/after.json b/tests/dictionaries/70container_files/makedict/after.json index 5c192e2b..0329a8b5 100644 --- a/tests/dictionaries/70container_files/makedict/after.json +++ b/tests/dictionaries/70container_files/makedict/after.json @@ -3,66 +3,18 @@ "owner": "default", "value": "oui" }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.rougail_conf.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.rougail_conf.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.rougail_conf.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.rougail_conf.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.rougail_conf.name": { "owner": "default", "value": "/rougail.conf" }, - "services.test.files.rougail_conf.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.rougail_conf.source": { - "owner": "default", - "value": "rougail.conf" - }, "services.test.files.rougail_conf.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70container_files/makedict/base.json b/tests/dictionaries/70container_files/makedict/base.json index fe8b4c83..ab53f2b8 100644 --- a/tests/dictionaries/70container_files/makedict/base.json +++ b/tests/dictionaries/70container_files/makedict/base.json @@ -1,20 +1,8 @@ { "rougail.general.mode_conteneur_actif": "oui", - "services.test.files.mailname.engine": "creole", - "services.test.files.mailname.group": "root", - "services.test.files.mailname.included": "no", - "services.test.files.mailname.mode": "0644", "services.test.files.mailname.name": "/etc/mailname", - "services.test.files.mailname.owner": "root", - "services.test.files.mailname.source": "mailname", "services.test.files.mailname.activate": true, - "services.test.files.rougail_conf.engine": "creole", - "services.test.files.rougail_conf.group": "root", - "services.test.files.rougail_conf.included": "no", - "services.test.files.rougail_conf.mode": "0644", "services.test.files.rougail_conf.name": "/rougail.conf", - "services.test.files.rougail_conf.owner": "root", - "services.test.files.rougail_conf.source": "rougail.conf", "services.test.files.rougail_conf.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/70container_files/makedict/before.json b/tests/dictionaries/70container_files/makedict/before.json index 5c192e2b..0329a8b5 100644 --- a/tests/dictionaries/70container_files/makedict/before.json +++ b/tests/dictionaries/70container_files/makedict/before.json @@ -3,66 +3,18 @@ "owner": "default", "value": "oui" }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.rougail_conf.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.rougail_conf.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.rougail_conf.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.rougail_conf.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.rougail_conf.name": { "owner": "default", "value": "/rougail.conf" }, - "services.test.files.rougail_conf.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.rougail_conf.source": { - "owner": "default", - "value": "rougail.conf" - }, "services.test.files.rougail_conf.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70container_files/tiramisu/base.py b/tests/dictionaries/70container_files/tiramisu/base.py index da69b45c..8afa8c72 100644 --- a/tests/dictionaries/70container_files/tiramisu/base.py +++ b/tests/dictionaries/70container_files/tiramisu/base.py @@ -14,27 +14,17 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="mailname") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) -option_17 = StrOption(name="engine", doc="engine", default="creole") -option_18 = StrOption(name="group", doc="group", default="root") -option_19 = StrOption(name="included", doc="included", default="no") -option_20 = StrOption(name="mode", doc="mode", default="0644") -option_21 = FilenameOption(name="name", doc="name", default="/rougail.conf") -option_22 = StrOption(name="owner", doc="owner", default="root") -option_23 = StrOption(name="source", doc="source", default="rougail.conf") -option_24 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24]) -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16]) -option_25 = BoolOption(name="activate", doc="activate", default=True) -option_26 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_25, option_26]) +option_8 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9]) +option_7.impl_set_information('source', "mailname") +option_11 = FilenameOption(name="name", doc="name", default="/rougail.conf") +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_10 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_11, option_12]) +option_10.impl_set_information('source', "rougail.conf") +option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) +option_13 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_13, option_14]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/70container_files_symlink_multi/makedict/after.json b/tests/dictionaries/70container_files_symlink_multi/makedict/after.json index e3a6bf88..38b626a1 100644 --- a/tests/dictionaries/70container_files_symlink_multi/makedict/after.json +++ b/tests/dictionaries/70container_files_symlink_multi/makedict/after.json @@ -13,22 +13,6 @@ "/etc/mailname4" ] }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": [ @@ -36,34 +20,10 @@ "/etc/mailname2" ] }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.mailname2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.mailname2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname2.name": { "owner": "default", "value": [ @@ -71,14 +31,6 @@ "/etc/mailname4" ] }, - "services.test.files.mailname2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.source": { - "owner": "default", - "value": "mailname2" - }, "services.test.files.mailname2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70container_files_symlink_multi/makedict/base.json b/tests/dictionaries/70container_files_symlink_multi/makedict/base.json index d4514538..ca49f33b 100644 --- a/tests/dictionaries/70container_files_symlink_multi/makedict/base.json +++ b/tests/dictionaries/70container_files_symlink_multi/makedict/base.json @@ -7,27 +7,15 @@ "/etc/mailname3", "/etc/mailname4" ], - "services.test.files.mailname.engine": "creole", - "services.test.files.mailname.group": "root", - "services.test.files.mailname.included": "no", - "services.test.files.mailname.mode": "0644", "services.test.files.mailname.name": [ "/etc/mailname", "/etc/mailname2" ], - "services.test.files.mailname.owner": "root", - "services.test.files.mailname.source": "mailname", "services.test.files.mailname.activate": true, - "services.test.files.mailname2.engine": "jinja2", - "services.test.files.mailname2.group": "root", - "services.test.files.mailname2.included": "no", - "services.test.files.mailname2.mode": "0644", "services.test.files.mailname2.name": [ "/etc/mailname3", "/etc/mailname4" ], - "services.test.files.mailname2.owner": "root", - "services.test.files.mailname2.source": "mailname2", "services.test.files.mailname2.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/70container_files_symlink_multi/makedict/before.json b/tests/dictionaries/70container_files_symlink_multi/makedict/before.json index e3a6bf88..38b626a1 100644 --- a/tests/dictionaries/70container_files_symlink_multi/makedict/before.json +++ b/tests/dictionaries/70container_files_symlink_multi/makedict/before.json @@ -13,22 +13,6 @@ "/etc/mailname4" ] }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": [ @@ -36,34 +20,10 @@ "/etc/mailname2" ] }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.mailname2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.mailname2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname2.name": { "owner": "default", "value": [ @@ -71,14 +31,6 @@ "/etc/mailname4" ] }, - "services.test.files.mailname2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.source": { - "owner": "default", - "value": "mailname2" - }, "services.test.files.mailname2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70container_files_symlink_multi/tiramisu/base.py b/tests/dictionaries/70container_files_symlink_multi/tiramisu/base.py index 9e7595d9..6202c21a 100644 --- a/tests/dictionaries/70container_files_symlink_multi/tiramisu/base.py +++ b/tests/dictionaries/70container_files_symlink_multi/tiramisu/base.py @@ -14,27 +14,18 @@ except: option_2 = FilenameOption(name="file_name", doc="file_name", multi=True, default=['/etc/mailname', '/etc/mailname2'], default_multi="/etc/mailname", properties=frozenset({"mandatory", "normal"})) option_3 = FilenameOption(name="file_name2", doc="file_name2", multi=True, default=['/etc/mailname3', '/etc/mailname4'], default_multi="/etc/mailname3", properties=frozenset({"mandatory", "normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = SymLinkOption(name="name", opt=option_2) -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="mailname") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) -option_17 = StrOption(name="engine", doc="engine", default="jinja2") -option_18 = StrOption(name="group", doc="group", default="root") -option_19 = StrOption(name="included", doc="included", default="no") -option_20 = StrOption(name="mode", doc="mode", default="0644") -option_21 = SymLinkOption(name="name", opt=option_3) -option_22 = StrOption(name="owner", doc="owner", default="root") -option_23 = StrOption(name="source", doc="source", default="mailname2") -option_24 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="mailname2", doc="mailname2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24]) -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16]) -option_25 = BoolOption(name="activate", doc="activate", default=True) -option_26 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_25, option_26]) +option_8 = SymLinkOption(name="name", opt=option_2) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9]) +option_7.impl_set_information('source', "mailname") +option_11 = SymLinkOption(name="name", opt=option_3) +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_10 = OptionDescription(name="mailname2", doc="mailname2", children=[option_11, option_12]) +option_10.impl_set_information('engine', "jinja2") +option_10.impl_set_information('source', "mailname2") +option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) +option_13 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_13, option_14]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/70container_files_symlink_multi_variable/makedict/after.json b/tests/dictionaries/70container_files_symlink_multi_variable/makedict/after.json index 6711d294..85f10914 100644 --- a/tests/dictionaries/70container_files_symlink_multi_variable/makedict/after.json +++ b/tests/dictionaries/70container_files_symlink_multi_variable/makedict/after.json @@ -20,22 +20,6 @@ "mailname2" ] }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": [ @@ -43,14 +27,6 @@ "/etc/mailname2" ] }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.variable": { "owner": "default", "value": [ @@ -62,22 +38,6 @@ "owner": "default", "value": true }, - "services.test.files.mailname2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.mailname2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname2.name": { "owner": "default", "value": [ @@ -85,14 +45,6 @@ "/etc/mailname4" ] }, - "services.test.files.mailname2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.source": { - "owner": "default", - "value": "mailname2" - }, "services.test.files.mailname2.variable": { "owner": "default", "value": [ diff --git a/tests/dictionaries/70container_files_symlink_multi_variable/makedict/base.json b/tests/dictionaries/70container_files_symlink_multi_variable/makedict/base.json index c5bacd74..3d2fce35 100644 --- a/tests/dictionaries/70container_files_symlink_multi_variable/makedict/base.json +++ b/tests/dictionaries/70container_files_symlink_multi_variable/makedict/base.json @@ -11,31 +11,19 @@ "mailname", "mailname2" ], - "services.test.files.mailname.engine": "creole", - "services.test.files.mailname.group": "root", - "services.test.files.mailname.included": "no", - "services.test.files.mailname.mode": "0644", "services.test.files.mailname.name": [ "/etc/mailname", "/etc/mailname2" ], - "services.test.files.mailname.owner": "root", - "services.test.files.mailname.source": "mailname", "services.test.files.mailname.variable": [ "mailname", "mailname2" ], "services.test.files.mailname.activate": true, - "services.test.files.mailname2.engine": "jinja2", - "services.test.files.mailname2.group": "root", - "services.test.files.mailname2.included": "no", - "services.test.files.mailname2.mode": "0644", "services.test.files.mailname2.name": [ "/etc/mailname3", "/etc/mailname4" ], - "services.test.files.mailname2.owner": "root", - "services.test.files.mailname2.source": "mailname2", "services.test.files.mailname2.variable": [ "mailname", "mailname2" diff --git a/tests/dictionaries/70container_files_symlink_multi_variable/makedict/before.json b/tests/dictionaries/70container_files_symlink_multi_variable/makedict/before.json index 6711d294..85f10914 100644 --- a/tests/dictionaries/70container_files_symlink_multi_variable/makedict/before.json +++ b/tests/dictionaries/70container_files_symlink_multi_variable/makedict/before.json @@ -20,22 +20,6 @@ "mailname2" ] }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": [ @@ -43,14 +27,6 @@ "/etc/mailname2" ] }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.variable": { "owner": "default", "value": [ @@ -62,22 +38,6 @@ "owner": "default", "value": true }, - "services.test.files.mailname2.engine": { - "owner": "default", - "value": "jinja2" - }, - "services.test.files.mailname2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname2.name": { "owner": "default", "value": [ @@ -85,14 +45,6 @@ "/etc/mailname4" ] }, - "services.test.files.mailname2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.source": { - "owner": "default", - "value": "mailname2" - }, "services.test.files.mailname2.variable": { "owner": "default", "value": [ diff --git a/tests/dictionaries/70container_files_symlink_multi_variable/tiramisu/base.py b/tests/dictionaries/70container_files_symlink_multi_variable/tiramisu/base.py index d5633dff..55a1ffa7 100644 --- a/tests/dictionaries/70container_files_symlink_multi_variable/tiramisu/base.py +++ b/tests/dictionaries/70container_files_symlink_multi_variable/tiramisu/base.py @@ -15,29 +15,20 @@ option_2 = FilenameOption(name="file_name", doc="file_name", multi=True, default option_3 = FilenameOption(name="file_name2", doc="file_name2", multi=True, default=['/etc/mailname3', '/etc/mailname4'], default_multi="/etc/mailname3", properties=frozenset({"mandatory", "normal"})) option_4 = StrOption(name="var", doc="var", multi=True, default=['mailname', 'mailname2'], default_multi="mailname", properties=frozenset({"mandatory", "normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3, option_4]) -option_9 = StrOption(name="engine", doc="engine", default="creole") -option_10 = StrOption(name="group", doc="group", default="root") -option_11 = StrOption(name="included", doc="included", default="no") -option_12 = StrOption(name="mode", doc="mode", default="0644") -option_13 = SymLinkOption(name="name", opt=option_2) -option_14 = StrOption(name="owner", doc="owner", default="root") -option_15 = StrOption(name="source", doc="source", default="mailname") -option_16 = SymLinkOption(name="variable", opt=option_4) -option_17 = BoolOption(name="activate", doc="activate", default=True) -option_8 = OptionDescription(name="mailname", doc="mailname", children=[option_9, option_10, option_11, option_12, option_13, option_14, option_15, option_16, option_17]) -option_19 = StrOption(name="engine", doc="engine", default="jinja2") -option_20 = StrOption(name="group", doc="group", default="root") -option_21 = StrOption(name="included", doc="included", default="no") -option_22 = StrOption(name="mode", doc="mode", default="0644") -option_23 = SymLinkOption(name="name", opt=option_3) -option_24 = StrOption(name="owner", doc="owner", default="root") -option_25 = StrOption(name="source", doc="source", default="mailname2") -option_26 = SymLinkOption(name="variable", opt=option_4) -option_27 = BoolOption(name="activate", doc="activate", default=True) -option_18 = OptionDescription(name="mailname2", doc="mailname2", children=[option_19, option_20, option_21, option_22, option_23, option_24, option_25, option_26, option_27]) -option_7 = OptionDescription(name="files", doc="files", children=[option_8, option_18]) -option_28 = BoolOption(name="activate", doc="activate", default=True) -option_29 = BoolOption(name="manage", doc="manage", default=True) -option_6 = OptionDescription(name="test", doc="test", children=[option_7, option_28, option_29]) +option_9 = SymLinkOption(name="name", opt=option_2) +option_10 = SymLinkOption(name="variable", opt=option_4) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_8 = OptionDescription(name="mailname", doc="mailname", children=[option_9, option_10, option_11]) +option_8.impl_set_information('source', "mailname") +option_13 = SymLinkOption(name="name", opt=option_3) +option_14 = SymLinkOption(name="variable", opt=option_4) +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_12 = OptionDescription(name="mailname2", doc="mailname2", children=[option_13, option_14, option_15]) +option_12.impl_set_information('engine', "jinja2") +option_12.impl_set_information('source', "mailname2") +option_7 = OptionDescription(name="files", doc="files", children=[option_8, option_12]) +option_16 = BoolOption(name="activate", doc="activate", default=True) +option_17 = BoolOption(name="manage", doc="manage", default=True) +option_6 = OptionDescription(name="test", doc="test", children=[option_7, option_16, option_17]) option_5 = OptionDescription(name="services", doc="services", children=[option_6], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5]) diff --git a/tests/dictionaries/70container_files_symlink_variable/makedict/after.json b/tests/dictionaries/70container_files_symlink_variable/makedict/after.json index e48099e4..06490541 100644 --- a/tests/dictionaries/70container_files_symlink_variable/makedict/after.json +++ b/tests/dictionaries/70container_files_symlink_variable/makedict/after.json @@ -7,34 +7,10 @@ "owner": "default", "value": "mailname" }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.variable": { "owner": "default", "value": "mailname" diff --git a/tests/dictionaries/70container_files_symlink_variable/makedict/base.json b/tests/dictionaries/70container_files_symlink_variable/makedict/base.json index e072ad39..6f9a4fd0 100644 --- a/tests/dictionaries/70container_files_symlink_variable/makedict/base.json +++ b/tests/dictionaries/70container_files_symlink_variable/makedict/base.json @@ -1,13 +1,7 @@ { "rougail.file_name": "/etc/mailname", "rougail.var": "mailname", - "services.test.files.mailname.engine": "creole", - "services.test.files.mailname.group": "root", - "services.test.files.mailname.included": "no", - "services.test.files.mailname.mode": "0644", "services.test.files.mailname.name": "/etc/mailname", - "services.test.files.mailname.owner": "root", - "services.test.files.mailname.source": "mailname", "services.test.files.mailname.variable": "mailname", "services.test.files.mailname.activate": true, "services.test.activate": true, diff --git a/tests/dictionaries/70container_files_symlink_variable/makedict/before.json b/tests/dictionaries/70container_files_symlink_variable/makedict/before.json index e48099e4..06490541 100644 --- a/tests/dictionaries/70container_files_symlink_variable/makedict/before.json +++ b/tests/dictionaries/70container_files_symlink_variable/makedict/before.json @@ -7,34 +7,10 @@ "owner": "default", "value": "mailname" }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.variable": { "owner": "default", "value": "mailname" diff --git a/tests/dictionaries/70container_files_symlink_variable/tiramisu/base.py b/tests/dictionaries/70container_files_symlink_variable/tiramisu/base.py index f23e7903..55bee8bf 100644 --- a/tests/dictionaries/70container_files_symlink_variable/tiramisu/base.py +++ b/tests/dictionaries/70container_files_symlink_variable/tiramisu/base.py @@ -14,19 +14,14 @@ except: option_2 = FilenameOption(name="file_name", doc="file_name", default="/etc/mailname", properties=frozenset({"mandatory", "normal"})) option_3 = StrOption(name="var", doc="var", default="mailname", properties=frozenset({"mandatory", "normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = SymLinkOption(name="name", opt=option_2) -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="mailname") -option_15 = SymLinkOption(name="variable", opt=option_3) -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15, option_16]) +option_8 = SymLinkOption(name="name", opt=option_2) +option_9 = SymLinkOption(name="variable", opt=option_3) +option_10 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9, option_10]) +option_7.impl_set_information('source', "mailname") option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_17 = BoolOption(name="activate", doc="activate", default=True) -option_18 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_17, option_18]) +option_11 = BoolOption(name="activate", doc="activate", default=True) +option_12 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_11, option_12]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/70container_files_twice/makedict/after.json b/tests/dictionaries/70container_files_twice/makedict/after.json index 2cd2d9ea..784f895b 100644 --- a/tests/dictionaries/70container_files_twice/makedict/after.json +++ b/tests/dictionaries/70container_files_twice/makedict/after.json @@ -3,98 +3,26 @@ "owner": "default", "value": "oui" }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.mailname_1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname_1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname_1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname_1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname_1.name": { "owner": "default", "value": "/etc/eole/mailname" }, - "services.test.files.mailname_1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname_1.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname_1.activate": { "owner": "default", "value": true }, - "services.test.files.rougail_conf.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.rougail_conf.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.rougail_conf.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.rougail_conf.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.rougail_conf.name": { "owner": "default", "value": "/rougail.conf" }, - "services.test.files.rougail_conf.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.rougail_conf.source": { - "owner": "default", - "value": "rougail.conf" - }, "services.test.files.rougail_conf.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70container_files_twice/makedict/base.json b/tests/dictionaries/70container_files_twice/makedict/base.json index 24f9d673..0022daab 100644 --- a/tests/dictionaries/70container_files_twice/makedict/base.json +++ b/tests/dictionaries/70container_files_twice/makedict/base.json @@ -1,28 +1,10 @@ { "rougail.general.mode_conteneur_actif": "oui", - "services.test.files.mailname.engine": "creole", - "services.test.files.mailname.group": "root", - "services.test.files.mailname.included": "no", - "services.test.files.mailname.mode": "0644", "services.test.files.mailname.name": "/etc/mailname", - "services.test.files.mailname.owner": "root", - "services.test.files.mailname.source": "mailname", "services.test.files.mailname.activate": true, - "services.test.files.mailname_1.engine": "creole", - "services.test.files.mailname_1.group": "root", - "services.test.files.mailname_1.included": "no", - "services.test.files.mailname_1.mode": "0644", "services.test.files.mailname_1.name": "/etc/eole/mailname", - "services.test.files.mailname_1.owner": "root", - "services.test.files.mailname_1.source": "mailname", "services.test.files.mailname_1.activate": true, - "services.test.files.rougail_conf.engine": "creole", - "services.test.files.rougail_conf.group": "root", - "services.test.files.rougail_conf.included": "no", - "services.test.files.rougail_conf.mode": "0644", "services.test.files.rougail_conf.name": "/rougail.conf", - "services.test.files.rougail_conf.owner": "root", - "services.test.files.rougail_conf.source": "rougail.conf", "services.test.files.rougail_conf.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/70container_files_twice/makedict/before.json b/tests/dictionaries/70container_files_twice/makedict/before.json index 2cd2d9ea..784f895b 100644 --- a/tests/dictionaries/70container_files_twice/makedict/before.json +++ b/tests/dictionaries/70container_files_twice/makedict/before.json @@ -3,98 +3,26 @@ "owner": "default", "value": "oui" }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.mailname_1.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname_1.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname_1.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname_1.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname_1.name": { "owner": "default", "value": "/etc/eole/mailname" }, - "services.test.files.mailname_1.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname_1.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname_1.activate": { "owner": "default", "value": true }, - "services.test.files.rougail_conf.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.rougail_conf.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.rougail_conf.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.rougail_conf.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.rougail_conf.name": { "owner": "default", "value": "/rougail.conf" }, - "services.test.files.rougail_conf.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.rougail_conf.source": { - "owner": "default", - "value": "rougail.conf" - }, "services.test.files.rougail_conf.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70container_files_twice/tiramisu/base.py b/tests/dictionaries/70container_files_twice/tiramisu/base.py index 82a665d0..b41e4ef7 100644 --- a/tests/dictionaries/70container_files_twice/tiramisu/base.py +++ b/tests/dictionaries/70container_files_twice/tiramisu/base.py @@ -14,36 +14,21 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="mailname") +option_8 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9]) +option_7.impl_set_information('source', "mailname") +option_11 = FilenameOption(name="name", doc="name", default="/etc/eole/mailname") +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_10 = OptionDescription(name="mailname_1", doc="mailname_1", children=[option_11, option_12]) +option_10.impl_set_information('source', "mailname") +option_14 = FilenameOption(name="name", doc="name", default="/rougail.conf") option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) -option_17 = StrOption(name="engine", doc="engine", default="creole") -option_18 = StrOption(name="group", doc="group", default="root") -option_19 = StrOption(name="included", doc="included", default="no") -option_20 = StrOption(name="mode", doc="mode", default="0644") -option_21 = FilenameOption(name="name", doc="name", default="/etc/eole/mailname") -option_22 = StrOption(name="owner", doc="owner", default="root") -option_23 = StrOption(name="source", doc="source", default="mailname") -option_24 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="mailname_1", doc="mailname_1", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24]) -option_26 = StrOption(name="engine", doc="engine", default="creole") -option_27 = StrOption(name="group", doc="group", default="root") -option_28 = StrOption(name="included", doc="included", default="no") -option_29 = StrOption(name="mode", doc="mode", default="0644") -option_30 = FilenameOption(name="name", doc="name", default="/rougail.conf") -option_31 = StrOption(name="owner", doc="owner", default="root") -option_32 = StrOption(name="source", doc="source", default="rougail.conf") -option_33 = BoolOption(name="activate", doc="activate", default=True) -option_25 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_26, option_27, option_28, option_29, option_30, option_31, option_32, option_33]) -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16, option_25]) -option_34 = BoolOption(name="activate", doc="activate", default=True) -option_35 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_34, option_35]) +option_13 = OptionDescription(name="rougail_conf", doc="rougail.conf", children=[option_14, option_15]) +option_13.impl_set_information('source', "rougail.conf") +option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13]) +option_16 = BoolOption(name="activate", doc="activate", default=True) +option_17 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/70container_filesmulti/makedict/after.json b/tests/dictionaries/70container_filesmulti/makedict/after.json index 1a7923ae..24097e2e 100644 --- a/tests/dictionaries/70container_filesmulti/makedict/after.json +++ b/tests/dictionaries/70container_filesmulti/makedict/after.json @@ -3,66 +3,18 @@ "owner": "default", "value": "oui" }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.mailname2.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname2.name": { "owner": "default", "value": "/etc/mailname2" }, - "services.test.files.mailname2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.source": { - "owner": "default", - "value": "mailname2" - }, "services.test.files.mailname2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70container_filesmulti/makedict/base.json b/tests/dictionaries/70container_filesmulti/makedict/base.json index f9f24114..deaab82d 100644 --- a/tests/dictionaries/70container_filesmulti/makedict/base.json +++ b/tests/dictionaries/70container_filesmulti/makedict/base.json @@ -1,20 +1,8 @@ { "rougail.general.mode_conteneur_actif": "oui", - "services.test.files.mailname.engine": "creole", - "services.test.files.mailname.group": "root", - "services.test.files.mailname.included": "no", - "services.test.files.mailname.mode": "0644", "services.test.files.mailname.name": "/etc/mailname", - "services.test.files.mailname.owner": "root", - "services.test.files.mailname.source": "mailname", "services.test.files.mailname.activate": true, - "services.test.files.mailname2.engine": "creole", - "services.test.files.mailname2.group": "root", - "services.test.files.mailname2.included": "no", - "services.test.files.mailname2.mode": "0644", "services.test.files.mailname2.name": "/etc/mailname2", - "services.test.files.mailname2.owner": "root", - "services.test.files.mailname2.source": "mailname2", "services.test.files.mailname2.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/70container_filesmulti/makedict/before.json b/tests/dictionaries/70container_filesmulti/makedict/before.json index 1a7923ae..24097e2e 100644 --- a/tests/dictionaries/70container_filesmulti/makedict/before.json +++ b/tests/dictionaries/70container_filesmulti/makedict/before.json @@ -3,66 +3,18 @@ "owner": "default", "value": "oui" }, - "services.test.files.mailname.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname.source": { - "owner": "default", - "value": "mailname" - }, "services.test.files.mailname.activate": { "owner": "default", "value": true }, - "services.test.files.mailname2.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname2.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname2.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname2.name": { "owner": "default", "value": "/etc/mailname2" }, - "services.test.files.mailname2.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname2.source": { - "owner": "default", - "value": "mailname2" - }, "services.test.files.mailname2.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70container_filesmulti/tiramisu/base.py b/tests/dictionaries/70container_filesmulti/tiramisu/base.py index 27d5b8c6..6b8c9c9b 100644 --- a/tests/dictionaries/70container_filesmulti/tiramisu/base.py +++ b/tests/dictionaries/70container_filesmulti/tiramisu/base.py @@ -14,27 +14,17 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="mailname") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) -option_17 = StrOption(name="engine", doc="engine", default="creole") -option_18 = StrOption(name="group", doc="group", default="root") -option_19 = StrOption(name="included", doc="included", default="no") -option_20 = StrOption(name="mode", doc="mode", default="0644") -option_21 = FilenameOption(name="name", doc="name", default="/etc/mailname2") -option_22 = StrOption(name="owner", doc="owner", default="root") -option_23 = StrOption(name="source", doc="source", default="mailname2") -option_24 = BoolOption(name="activate", doc="activate", default=True) -option_16 = OptionDescription(name="mailname2", doc="mailname2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24]) -option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16]) -option_25 = BoolOption(name="activate", doc="activate", default=True) -option_26 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_25, option_26]) +option_8 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="mailname", doc="mailname", children=[option_8, option_9]) +option_7.impl_set_information('source', "mailname") +option_11 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_12 = BoolOption(name="activate", doc="activate", default=True) +option_10 = OptionDescription(name="mailname2", doc="mailname2", children=[option_11, option_12]) +option_10.impl_set_information('source', "mailname2") +option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10]) +option_13 = BoolOption(name="activate", doc="activate", default=True) +option_14 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_13, option_14]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/70container_filesredefine/makedict/after.json b/tests/dictionaries/70container_filesredefine/makedict/after.json index 74cbb06d..4c4c7f95 100644 --- a/tests/dictionaries/70container_filesredefine/makedict/after.json +++ b/tests/dictionaries/70container_filesredefine/makedict/after.json @@ -3,34 +3,10 @@ "owner": "default", "value": "oui" }, - "services.test.files.mailname_new.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname_new.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname_new.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname_new.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname_new.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname_new.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname_new.source": { - "owner": "default", - "value": "mailname.new" - }, "services.test.files.mailname_new.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70container_filesredefine/makedict/base.json b/tests/dictionaries/70container_filesredefine/makedict/base.json index 02f6cd11..c7451841 100644 --- a/tests/dictionaries/70container_filesredefine/makedict/base.json +++ b/tests/dictionaries/70container_filesredefine/makedict/base.json @@ -1,12 +1,6 @@ { "rougail.general.mode_conteneur_actif": "oui", - "services.test.files.mailname_new.engine": "creole", - "services.test.files.mailname_new.group": "root", - "services.test.files.mailname_new.included": "no", - "services.test.files.mailname_new.mode": "0644", "services.test.files.mailname_new.name": "/etc/mailname", - "services.test.files.mailname_new.owner": "root", - "services.test.files.mailname_new.source": "mailname.new", "services.test.files.mailname_new.activate": true, "services.test.activate": true, "services.test.manage": true diff --git a/tests/dictionaries/70container_filesredefine/makedict/before.json b/tests/dictionaries/70container_filesredefine/makedict/before.json index 74cbb06d..4c4c7f95 100644 --- a/tests/dictionaries/70container_filesredefine/makedict/before.json +++ b/tests/dictionaries/70container_filesredefine/makedict/before.json @@ -3,34 +3,10 @@ "owner": "default", "value": "oui" }, - "services.test.files.mailname_new.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.mailname_new.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname_new.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.mailname_new.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.mailname_new.name": { "owner": "default", "value": "/etc/mailname" }, - "services.test.files.mailname_new.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.mailname_new.source": { - "owner": "default", - "value": "mailname.new" - }, "services.test.files.mailname_new.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70container_filesredefine/tiramisu/base.py b/tests/dictionaries/70container_filesredefine/tiramisu/base.py index 685264a4..6b48225e 100644 --- a/tests/dictionaries/70container_filesredefine/tiramisu/base.py +++ b/tests/dictionaries/70container_filesredefine/tiramisu/base.py @@ -14,18 +14,13 @@ except: option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/mailname") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="mailname.new") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="mailname_new", doc="mailname.new", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) +option_8 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="mailname_new", doc="mailname.new", children=[option_8, option_9]) +option_7.impl_set_information('source', "mailname.new") option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_16 = BoolOption(name="activate", doc="activate", default=True) -option_17 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17]) +option_10 = BoolOption(name="activate", doc="activate", default=True) +option_11 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_10, option_11]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) diff --git a/tests/dictionaries/70service_not_managed/makedict/after.json b/tests/dictionaries/70service_not_managed/makedict/after.json index 03f90b20..8b3606f3 100644 --- a/tests/dictionaries/70service_not_managed/makedict/after.json +++ b/tests/dictionaries/70service_not_managed/makedict/after.json @@ -3,34 +3,10 @@ "owner": "default", "value": "mailname" }, - "services.test.files.test.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.test.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.test.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.test.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.test.name": { "owner": "default", "value": "/tmp/test" }, - "services.test.files.test.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.test.source": { - "owner": "default", - "value": "test" - }, "services.test.files.test.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70service_not_managed/makedict/base.json b/tests/dictionaries/70service_not_managed/makedict/base.json index e67af74a..60918376 100644 --- a/tests/dictionaries/70service_not_managed/makedict/base.json +++ b/tests/dictionaries/70service_not_managed/makedict/base.json @@ -1,12 +1,6 @@ { "rougail.var": "mailname", - "services.test.files.test.engine": "creole", - "services.test.files.test.group": "root", - "services.test.files.test.included": "no", - "services.test.files.test.mode": "0644", "services.test.files.test.name": "/tmp/test", - "services.test.files.test.owner": "root", - "services.test.files.test.source": "test", "services.test.files.test.activate": true, "services.test.activate": true, "services.test.manage": false diff --git a/tests/dictionaries/70service_not_managed/makedict/before.json b/tests/dictionaries/70service_not_managed/makedict/before.json index 03f90b20..8b3606f3 100644 --- a/tests/dictionaries/70service_not_managed/makedict/before.json +++ b/tests/dictionaries/70service_not_managed/makedict/before.json @@ -3,34 +3,10 @@ "owner": "default", "value": "mailname" }, - "services.test.files.test.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.test.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.test.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.test.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.test.name": { "owner": "default", "value": "/tmp/test" }, - "services.test.files.test.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.test.source": { - "owner": "default", - "value": "test" - }, "services.test.files.test.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70service_not_managed/tiramisu/base.py b/tests/dictionaries/70service_not_managed/tiramisu/base.py index 7c51f1d8..7d45ebc1 100644 --- a/tests/dictionaries/70service_not_managed/tiramisu/base.py +++ b/tests/dictionaries/70service_not_managed/tiramisu/base.py @@ -13,18 +13,13 @@ except: from tiramisu import * option_2 = StrOption(name="var", doc="var", default="mailname", properties=frozenset({"mandatory", "normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) -option_7 = StrOption(name="engine", doc="engine", default="creole") -option_8 = StrOption(name="group", doc="group", default="root") -option_9 = StrOption(name="included", doc="included", default="no") -option_10 = StrOption(name="mode", doc="mode", default="0644") -option_11 = FilenameOption(name="name", doc="name", default="/tmp/test") -option_12 = StrOption(name="owner", doc="owner", default="root") -option_13 = StrOption(name="source", doc="source", default="test") -option_14 = BoolOption(name="activate", doc="activate", default=True) -option_6 = OptionDescription(name="test", doc="test", children=[option_7, option_8, option_9, option_10, option_11, option_12, option_13, option_14]) +option_7 = FilenameOption(name="name", doc="name", default="/tmp/test") +option_8 = BoolOption(name="activate", doc="activate", default=True) +option_6 = OptionDescription(name="test", doc="test", children=[option_7, option_8]) +option_6.impl_set_information('source', "test") option_5 = OptionDescription(name="files", doc="files", children=[option_6]) -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_16 = BoolOption(name="manage", doc="manage", default=False) -option_4 = OptionDescription(name="test", doc="test", children=[option_5, option_15, option_16]) +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_10 = BoolOption(name="manage", doc="manage", default=False) +option_4 = OptionDescription(name="test", doc="test", children=[option_5, option_9, option_10]) option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3]) diff --git a/tests/dictionaries/70service_servicelist_file/makedict/after.json b/tests/dictionaries/70service_servicelist_file/makedict/after.json index 0df03129..7fc9693a 100644 --- a/tests/dictionaries/70service_servicelist_file/makedict/after.json +++ b/tests/dictionaries/70service_servicelist_file/makedict/after.json @@ -7,34 +7,10 @@ "owner": "default", "value": "192.168.0.1" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70service_servicelist_file/makedict/base.json b/tests/dictionaries/70service_servicelist_file/makedict/base.json index 0c5252fa..8b3252bf 100644 --- a/tests/dictionaries/70service_servicelist_file/makedict/base.json +++ b/tests/dictionaries/70service_servicelist_file/makedict/base.json @@ -1,13 +1,7 @@ { "rougail.condition": "no", "rougail.nut_monitor_host": "192.168.0.1", - "services.test.files.file.engine": "creole", - "services.test.files.file.group": "root", - "services.test.files.file.included": "no", - "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", - "services.test.files.file.owner": "root", - "services.test.files.file.source": "file", "services.test.files.file.activate": true, "services.test.activate": false, "services.test.manage": true diff --git a/tests/dictionaries/70service_servicelist_file/makedict/before.json b/tests/dictionaries/70service_servicelist_file/makedict/before.json index 0df03129..7fc9693a 100644 --- a/tests/dictionaries/70service_servicelist_file/makedict/before.json +++ b/tests/dictionaries/70service_servicelist_file/makedict/before.json @@ -7,34 +7,10 @@ "owner": "default", "value": "192.168.0.1" }, - "services.test.files.file.engine": { - "owner": "default", - "value": "creole" - }, - "services.test.files.file.group": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.included": { - "owner": "default", - "value": "no" - }, - "services.test.files.file.mode": { - "owner": "default", - "value": "0644" - }, "services.test.files.file.name": { "owner": "default", "value": "/etc/file" }, - "services.test.files.file.owner": { - "owner": "default", - "value": "root" - }, - "services.test.files.file.source": { - "owner": "default", - "value": "file" - }, "services.test.files.file.activate": { "owner": "default", "value": true diff --git a/tests/dictionaries/70service_servicelist_file/tiramisu/base.py b/tests/dictionaries/70service_servicelist_file/tiramisu/base.py index fa6bc7f2..17af3ad9 100644 --- a/tests/dictionaries/70service_servicelist_file/tiramisu/base.py +++ b/tests/dictionaries/70service_servicelist_file/tiramisu/base.py @@ -14,18 +14,13 @@ except: option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"})) option_3 = IPOption(name="nut_monitor_host", doc="nut_monitor_host", default="192.168.0.1", allow_reserved=True, properties=frozenset({"mandatory", "normal"})) option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2, option_3]) -option_8 = StrOption(name="engine", doc="engine", default="creole") -option_9 = StrOption(name="group", doc="group", default="root") -option_10 = StrOption(name="included", doc="included", default="no") -option_11 = StrOption(name="mode", doc="mode", default="0644") -option_12 = FilenameOption(name="name", doc="name", default="/etc/file") -option_13 = StrOption(name="owner", doc="owner", default="root") -option_14 = StrOption(name="source", doc="source", default="file") -option_15 = BoolOption(name="activate", doc="activate", default=True) -option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15]) +option_8 = FilenameOption(name="name", doc="name", default="/etc/file") +option_9 = BoolOption(name="activate", doc="activate", default=True) +option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9]) +option_7.impl_set_information('source', "file") option_6 = OptionDescription(name="files", doc="files", children=[option_7]) -option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) -option_17 = BoolOption(name="manage", doc="manage", default=True) -option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17]) +option_10 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_2, notraisepropertyerror=True), 'expected_0': ParamValue("no")}))) +option_11 = BoolOption(name="manage", doc="manage", default=True) +option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_10, option_11]) option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4]) From 3999969aa0327ff2cd02a08ada2cee126113e4ae Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sun, 4 Apr 2021 19:42:12 +0200 Subject: [PATCH 2/4] In creole template support of %%lead.follower2 and %%lead['follower2'] notation %if 'follower1' in %%lead now search if a follower exists has follower --- src/rougail/template/base.py | 31 ++++++++++++------- .../40ifin_leadershipauto/result/etc/mailname | 4 +++ .../40ifin_leadershipauto/tmpl/mailname | 11 +++++++ 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/rougail/template/base.py b/src/rougail/template/base.py index 5cad8ff5..9b335b48 100644 --- a/src/rougail/template/base.py +++ b/src/rougail/template/base.py @@ -74,12 +74,21 @@ class RougailLeaderIndex: def __getattr__(self, name): if name not in self._follower: - raise AttributeError() + raise AttributeError(f'unable to find follower "{name}"') value = self._follower[name] if isinstance(value, PropertiesOptionError): - raise AttributeError() + raise AttributeError(f'unable to access to follower "{name}": {value}') return value + def __getitem__(self, name): + return self.__getattr__(name) + + def __contains__(self, name): + if self._follower.__contains__(name): + value = self._follower[name] + return not isinstance(value, PropertiesOptionError) + return False + def __str__(self): return str(self._value) @@ -141,11 +150,11 @@ class RougailLeader: def __contains__(self, value): return self._value.__contains__(value) - async def add_follower(self, - config, - name: str, - path: str, - ): + async def _add_follower(self, + config, + name: str, + path: str, + ): """Add a new follower """ self._follower[name] = [] @@ -389,10 +398,10 @@ class RougailBaseTemplate: if is_variable_namespace: self.rougail_variables_dict[await suboption.option.name()] = leader else: - await leader.add_follower(self.config, - await suboption.option.name(), - await suboption.option.path(), - ) + await leader._add_follower(self.config, + await suboption.option.name(), + await suboption.option.path(), + ) variables[leader_name] = leader else: if is_service_namespace == 'root': diff --git a/tests/dictionaries/40ifin_leadershipauto/result/etc/mailname b/tests/dictionaries/40ifin_leadershipauto/result/etc/mailname index 155aa30c..6da0a4c2 100644 --- a/tests/dictionaries/40ifin_leadershipauto/result/etc/mailname +++ b/tests/dictionaries/40ifin_leadershipauto/result/etc/mailname @@ -1,2 +1,6 @@ +#attr +leader: a +follower2: +#key leader: a follower2: diff --git a/tests/dictionaries/40ifin_leadershipauto/tmpl/mailname b/tests/dictionaries/40ifin_leadershipauto/tmpl/mailname index 43dbe7d1..507012d7 100644 --- a/tests/dictionaries/40ifin_leadershipauto/tmpl/mailname +++ b/tests/dictionaries/40ifin_leadershipauto/tmpl/mailname @@ -1,3 +1,4 @@ +#attr %for %%lead in %%leader leader: %%lead %if %%hasattr(%%lead, 'follower1') @@ -7,3 +8,13 @@ follower1: %%lead.follower1 follower2: %%lead.follower2 %end if %end for +#key +%for %%lead in %%leader +leader: %%lead +%if 'follower1' in %%lead +follower1: %%lead['follower1'] +%end if +%if 'follower2' in %%lead +follower2: %%lead['follower2'] +%end if +%end for From b7cedd85fba0c898dcb2835036b2f33f42871d25 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 12 Apr 2021 15:04:15 +0200 Subject: [PATCH 3/4] support leadership name in extra --- doc/variable/leadership.md | 8 ++-- src/rougail/template/base.py | 8 ++-- .../60extra_group_name/00-base.xml | 19 ++++++++ .../60extra_group_name/__init__.py | 0 .../extra_dirs/extra/00-base.xml | 19 ++++++++ .../60extra_group_name/makedict/after.json | 48 +++++++++++++++++++ .../60extra_group_name/makedict/base.json | 16 +++++++ .../60extra_group_name/makedict/before.json | 48 +++++++++++++++++++ .../60extra_group_name/result/etc/mailname | 11 +++++ .../60extra_group_name/result/etc/mailname2 | 11 +++++ .../result/tmpfiles.d/rougail.conf | 4 ++ .../60extra_group_name/tiramisu/base.py | 37 ++++++++++++++ .../60extra_group_name/tmpl/mailname | 35 ++++++++++++++ .../60extra_group_name/tmpl/mailname2 | 33 +++++++++++++ 14 files changed, 290 insertions(+), 7 deletions(-) create mode 100644 tests/dictionaries/60extra_group_name/00-base.xml create mode 100644 tests/dictionaries/60extra_group_name/__init__.py create mode 100644 tests/dictionaries/60extra_group_name/extra_dirs/extra/00-base.xml create mode 100644 tests/dictionaries/60extra_group_name/makedict/after.json create mode 100644 tests/dictionaries/60extra_group_name/makedict/base.json create mode 100644 tests/dictionaries/60extra_group_name/makedict/before.json create mode 100644 tests/dictionaries/60extra_group_name/result/etc/mailname create mode 100644 tests/dictionaries/60extra_group_name/result/etc/mailname2 create mode 100644 tests/dictionaries/60extra_group_name/result/tmpfiles.d/rougail.conf create mode 100644 tests/dictionaries/60extra_group_name/tiramisu/base.py create mode 100644 tests/dictionaries/60extra_group_name/tmpl/mailname create mode 100644 tests/dictionaries/60extra_group_name/tmpl/mailname2 diff --git a/doc/variable/leadership.md b/doc/variable/leadership.md index 1e4ca5cd..2a2cf072 100644 --- a/doc/variable/leadership.md +++ b/doc/variable/leadership.md @@ -74,15 +74,15 @@ Voici un exemple de définition d'une variable meneuse et de deux variables mene - example.family.follower1 - example.family.follower2 + follower1 + follower2 ``` -Le chemin de la variable meneuse est traditionnel, par contre le chemin des variables suiveuses n'est pas le chemin définitif de la variable. +Le chemin de la variable meneuse est traditionnel, par contre le chemin des variables suiveuses est le chemin relatif de la variable. -Le chemin d'une variable suiveuse est normalement "example.family.leader.follower1" mais la variable n'est pas encore une variable suiveuse à ce moment là du traitement. C'est pour cela qu'il ne faut, uniquement dans les groupes, mettre le nom de la variable meneuse dans le chemin. +Le chemin d'une variable suiveuse est normalement "example.family.leader.follower1" mais la variable n'est pas encore une variable suiveuse à ce moment là du traitement. C'est pour cela qu'il ne faut, uniquement dans les groupes, mettre le nom de la variable suiveuse. ## Ajout d'une nouvelle variable suiveuse diff --git a/src/rougail/template/base.py b/src/rougail/template/base.py index 9b335b48..edcffaae 100644 --- a/src/rougail/template/base.py +++ b/src/rougail/template/base.py @@ -122,10 +122,11 @@ class RougailLeader: For examples: %%leader, %%leader[0].follower1 """ def __init__(self, + leader_name, value, ) -> None: self._value = value - self._follower = {} + self._follower = {leader_name: value} def __getitem__(self, index): """Get a leader.follower at requested index. @@ -393,8 +394,9 @@ class RougailBaseTemplate: if await option.option.isleadership(): for idx, suboption in enumerate(await option.list('all')): if idx == 0: - leader = RougailLeader(await suboption.value.get()) leader_name = await suboption.option.name() + leader = RougailLeader(leader_name, await suboption.value.get()) + leadership_name = await option.option.name() if is_variable_namespace: self.rougail_variables_dict[await suboption.option.name()] = leader else: @@ -402,7 +404,7 @@ class RougailBaseTemplate: await suboption.option.name(), await suboption.option.path(), ) - variables[leader_name] = leader + variables[leadership_name] = leader else: if is_service_namespace == 'root': new_is_service_namespace = 'service_name' diff --git a/tests/dictionaries/60extra_group_name/00-base.xml b/tests/dictionaries/60extra_group_name/00-base.xml new file mode 100644 index 00000000..268c2024 --- /dev/null +++ b/tests/dictionaries/60extra_group_name/00-base.xml @@ -0,0 +1,19 @@ + + + + + /etc/mailname + /etc/mailname2 + + + + + + + + + diff --git a/tests/dictionaries/60extra_group_name/__init__.py b/tests/dictionaries/60extra_group_name/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/dictionaries/60extra_group_name/extra_dirs/extra/00-base.xml b/tests/dictionaries/60extra_group_name/extra_dirs/extra/00-base.xml new file mode 100644 index 00000000..6a507abe --- /dev/null +++ b/tests/dictionaries/60extra_group_name/extra_dirs/extra/00-base.xml @@ -0,0 +1,19 @@ + + + + + + + test + + + pre + + + + + + mode + + + diff --git a/tests/dictionaries/60extra_group_name/makedict/after.json b/tests/dictionaries/60extra_group_name/makedict/after.json new file mode 100644 index 00000000..706146a9 --- /dev/null +++ b/tests/dictionaries/60extra_group_name/makedict/after.json @@ -0,0 +1,48 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": "non" + }, + "rougail.general.activer_ejabberd": { + "owner": "default", + "value": "non" + }, + "extra.ejabberd.new_name.description": { + "owner": "default", + "value": [ + "test" + ] + }, + "extra.ejabberd.new_name.mode": { + "owner": [ + "default" + ], + "value": [ + "pre" + ] + }, + "services.test.files.mailname.name": { + "owner": "default", + "value": "/etc/mailname" + }, + "services.test.files.mailname.activate": { + "owner": "default", + "value": true + }, + "services.test.files.mailname2.name": { + "owner": "default", + "value": "/etc/mailname2" + }, + "services.test.files.mailname2.activate": { + "owner": "default", + "value": true + }, + "services.test.activate": { + "owner": "default", + "value": true + }, + "services.test.manage": { + "owner": "default", + "value": true + } +} diff --git a/tests/dictionaries/60extra_group_name/makedict/base.json b/tests/dictionaries/60extra_group_name/makedict/base.json new file mode 100644 index 00000000..5e9f4d0f --- /dev/null +++ b/tests/dictionaries/60extra_group_name/makedict/base.json @@ -0,0 +1,16 @@ +{ + "rougail.general.mode_conteneur_actif": "non", + "rougail.general.activer_ejabberd": "non", + "extra.ejabberd.new_name.description": [ + { + "extra.ejabberd.new_name.description": "test", + "extra.ejabberd.new_name.mode": "pre" + } + ], + "services.test.files.mailname.name": "/etc/mailname", + "services.test.files.mailname.activate": true, + "services.test.files.mailname2.name": "/etc/mailname2", + "services.test.files.mailname2.activate": true, + "services.test.activate": true, + "services.test.manage": true +} diff --git a/tests/dictionaries/60extra_group_name/makedict/before.json b/tests/dictionaries/60extra_group_name/makedict/before.json new file mode 100644 index 00000000..706146a9 --- /dev/null +++ b/tests/dictionaries/60extra_group_name/makedict/before.json @@ -0,0 +1,48 @@ +{ + "rougail.general.mode_conteneur_actif": { + "owner": "default", + "value": "non" + }, + "rougail.general.activer_ejabberd": { + "owner": "default", + "value": "non" + }, + "extra.ejabberd.new_name.description": { + "owner": "default", + "value": [ + "test" + ] + }, + "extra.ejabberd.new_name.mode": { + "owner": [ + "default" + ], + "value": [ + "pre" + ] + }, + "services.test.files.mailname.name": { + "owner": "default", + "value": "/etc/mailname" + }, + "services.test.files.mailname.activate": { + "owner": "default", + "value": true + }, + "services.test.files.mailname2.name": { + "owner": "default", + "value": "/etc/mailname2" + }, + "services.test.files.mailname2.activate": { + "owner": "default", + "value": true + }, + "services.test.activate": { + "owner": "default", + "value": true + }, + "services.test.manage": { + "owner": "default", + "value": true + } +} diff --git a/tests/dictionaries/60extra_group_name/result/etc/mailname b/tests/dictionaries/60extra_group_name/result/etc/mailname new file mode 100644 index 00000000..dc34cc5b --- /dev/null +++ b/tests/dictionaries/60extra_group_name/result/etc/mailname @@ -0,0 +1,11 @@ +contain test +1 +leader: test +follower: pre +supeq +sup +diff +testpre +pretest +leader2: test +follower2: pre diff --git a/tests/dictionaries/60extra_group_name/result/etc/mailname2 b/tests/dictionaries/60extra_group_name/result/etc/mailname2 new file mode 100644 index 00000000..dc34cc5b --- /dev/null +++ b/tests/dictionaries/60extra_group_name/result/etc/mailname2 @@ -0,0 +1,11 @@ +contain test +1 +leader: test +follower: pre +supeq +sup +diff +testpre +pretest +leader2: test +follower2: pre diff --git a/tests/dictionaries/60extra_group_name/result/tmpfiles.d/rougail.conf b/tests/dictionaries/60extra_group_name/result/tmpfiles.d/rougail.conf new file mode 100644 index 00000000..7a8d00f4 --- /dev/null +++ b/tests/dictionaries/60extra_group_name/result/tmpfiles.d/rougail.conf @@ -0,0 +1,4 @@ +C /etc/mailname 0644 root root - /usr/local/lib/etc/mailname +z /etc/mailname - - - - - +C /etc/mailname2 0644 root root - /usr/local/lib/etc/mailname2 +z /etc/mailname2 - - - - - diff --git a/tests/dictionaries/60extra_group_name/tiramisu/base.py b/tests/dictionaries/60extra_group_name/tiramisu/base.py new file mode 100644 index 00000000..13ce8ee0 --- /dev/null +++ b/tests/dictionaries/60extra_group_name/tiramisu/base.py @@ -0,0 +1,37 @@ +from importlib.machinery import SourceFileLoader +from importlib.util import spec_from_loader, module_from_spec +loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py') +spec = spec_from_loader(loader.name, loader) +func = module_from_spec(spec) +loader.exec_module(func) +for key, value in dict(locals()).items(): + if key != ['SourceFileLoader', 'func']: + setattr(func, key, value) +try: + from tiramisu3 import * +except: + from tiramisu import * +option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_4 = StrOption(name="activer_ejabberd", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"})) +option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"})) +option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2]) +option_8 = StrOption(name="description", doc="description", multi=True, default=['test'], properties=frozenset({"mandatory"})) +option_9 = StrOption(name="mode", doc="mode", multi=True, default_multi="pre", properties=frozenset({"mandatory", "normal"})) +option_7 = Leadership(name="new_name", doc="new_name", children=[option_8, option_9], properties=frozenset({"normal"})) +option_6 = OptionDescription(name="ejabberd", doc="ejabberd", children=[option_7], properties=frozenset({"normal"})) +option_5 = OptionDescription(name="extra", doc="extra", children=[option_6]) +option_14 = FilenameOption(name="name", doc="name", default="/etc/mailname") +option_15 = BoolOption(name="activate", doc="activate", default=True) +option_13 = OptionDescription(name="mailname", doc="mailname", children=[option_14, option_15]) +option_13.impl_set_information('source', "mailname") +option_17 = FilenameOption(name="name", doc="name", default="/etc/mailname2") +option_18 = BoolOption(name="activate", doc="activate", default=True) +option_16 = OptionDescription(name="mailname2", doc="mailname2", children=[option_17, option_18]) +option_16.impl_set_information('engine', "jinja2") +option_16.impl_set_information('source', "mailname2") +option_12 = OptionDescription(name="files", doc="files", children=[option_13, option_16]) +option_19 = BoolOption(name="activate", doc="activate", default=True) +option_20 = BoolOption(name="manage", doc="manage", default=True) +option_11 = OptionDescription(name="test", doc="test", children=[option_12, option_19, option_20]) +option_10 = OptionDescription(name="services", doc="services", children=[option_11], properties=frozenset({"hidden"})) +option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_5, option_10]) diff --git a/tests/dictionaries/60extra_group_name/tmpl/mailname b/tests/dictionaries/60extra_group_name/tmpl/mailname new file mode 100644 index 00000000..23cbe10e --- /dev/null +++ b/tests/dictionaries/60extra_group_name/tmpl/mailname @@ -0,0 +1,35 @@ +%if 'test' in %%extra.ejabberd.new_name +contain test +%end if +%%len(%%extra.ejabberd.new_name) +%if 'a' in %%extra.ejabberd.new_name +contain a +%end if +%for %%description in %%extra.ejabberd.new_name +leader: %%description +follower: %%description.mode +%if %%description <= %%description.mode +infeq +%end if +%if %%description >= %%description.mode +supeq +%end if +%if %%description < %%description.mode +inf +%end if +%if %%description > %%description.mode +sup +%end if +%if %%description == %%description.mode +eq +%end if +%if %%description != %%description.mode +diff +%end if +%set %%var = %%description + %%description.mode +%%var +%set %%var = %%description.mode + %%description +%%var +%end for +leader2: %%extra.ejabberd.new_name[0].description +follower2: %%extra.ejabberd.new_name[0].mode diff --git a/tests/dictionaries/60extra_group_name/tmpl/mailname2 b/tests/dictionaries/60extra_group_name/tmpl/mailname2 new file mode 100644 index 00000000..4860700d --- /dev/null +++ b/tests/dictionaries/60extra_group_name/tmpl/mailname2 @@ -0,0 +1,33 @@ +{% if 'test' in extra.ejabberd.new_name -%} +contain test +{% endif -%} +{{ extra.ejabberd.new_name |length }} +{% if 'a' in extra.ejabberd.new_name -%} +contain a +{% endif -%} +{% for description in extra.ejabberd.new_name -%} +leader: {{ description }} +follower: {{ description.mode }} +{% if description <= description.mode -%} +infeq +{% endif -%} +{% if description >= description.mode -%} +supeq +{% endif -%} +{% if description < description.mode -%} +inf +{% endif -%} +{% if description > description.mode -%} +sup +{% endif -%} +{% if description == description.mode -%} +eq +{% endif -%} +{% if description != description.mode -%} +diff +{% endif -%} +{{ description + description.mode }} +{{ description.mode + description }} +{% endfor -%} +leader2: {{ extra.ejabberd.new_name[0].description }} +follower2: {{ extra.ejabberd.new_name[0].mode }} From f4471c4875f95500b7ce566aa3f15b4ee683f6a9 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 12 Apr 2021 15:04:38 +0200 Subject: [PATCH 4/4] can add extra annotators --- src/rougail/annotator/__init__.py | 56 ++++++++++++++++++------------ src/rougail/annotator/check.py | 14 ++++---- src/rougail/annotator/condition.py | 14 ++++---- src/rougail/annotator/family.py | 11 +++--- src/rougail/annotator/fill.py | 28 +++++++-------- src/rougail/annotator/group.py | 10 +++--- src/rougail/annotator/param.py | 6 ++-- src/rougail/annotator/property.py | 14 +++++--- src/rougail/annotator/service.py | 14 +++++--- src/rougail/annotator/target.py | 4 +-- src/rougail/annotator/value.py | 10 +++--- src/rougail/annotator/variable.py | 10 +++--- src/rougail/config.py | 1 + src/rougail/data/rougail.dtd | 4 +-- 14 files changed, 114 insertions(+), 82 deletions(-) diff --git a/src/rougail/annotator/__init__.py b/src/rougail/annotator/__init__.py index 6c1ee0c6..ba1bfec7 100644 --- a/src/rougail/annotator/__init__.py +++ b/src/rougail/annotator/__init__.py @@ -24,34 +24,44 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -from .group import GroupAnnotator -from .service import ServiceAnnotator -from .variable import VariableAnnotator, CONVERT_OPTION -from .check import CheckAnnotator -from .value import ValueAnnotator -from .condition import ConditionAnnotator -from .fill import FillAnnotator -from .family import FamilyAnnotator -from .property import PropertyAnnotator +from .variable import CONVERT_OPTION +import importlib.resources +from ..utils import load_modules + + +ANNOTATORS = None + + +def get_level(module): + return module.level + + +def get_annotators(annotators, module_name): + annotators[module_name] = [] + for pathobj in importlib.resources.files(module_name).iterdir(): + path = str(pathobj) + if not path.endswith('__') and not path.endswith('__.py'): + module = load_modules(path) + if 'Annotator' in dir(module): + annotators[module_name].append(module.Annotator) + class SpaceAnnotator: # pylint: disable=R0903 """Transformations applied on a object instance """ def __init__(self, objectspace, eosfunc_file): - self.objectspace = objectspace - GroupAnnotator(objectspace) - ServiceAnnotator(objectspace) - VariableAnnotator(objectspace) - CheckAnnotator(objectspace, - eosfunc_file, - ) - ConditionAnnotator(objectspace) - FillAnnotator(objectspace, - eosfunc_file, - ) - ValueAnnotator(objectspace) - FamilyAnnotator(objectspace) - PropertyAnnotator(objectspace) + global ANNOTATORS + if ANNOTATORS is None: + ANNOTATORS = {} + get_annotators(ANNOTATORS, 'rougail.annotator') + for extra_annotator in objectspace.rougailconfig['extra_annotators']: + get_annotators(ANNOTATORS, extra_annotator) + annotators = ANNOTATORS['rougail.annotator'].copy() + for extra_annotator in objectspace.rougailconfig['extra_annotators']: + annotators.extend(ANNOTATORS[extra_annotator]) + annotators = sorted(annotators, key=get_level) + for annotator in annotators: + annotator(objectspace, eosfunc_file) __all__ = ('SpaceAnnotator', 'CONVERT_OPTION') diff --git a/src/rougail/annotator/check.py b/src/rougail/annotator/check.py index f2e1bdde..f006831c 100644 --- a/src/rougail/annotator/check.py +++ b/src/rougail/annotator/check.py @@ -26,21 +26,23 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ from typing import List, Any -from .target import TargetAnnotator -from .param import ParamAnnotator +from rougail.annotator.target import TargetAnnotator +from rougail.annotator.param import ParamAnnotator -from ..utils import load_modules -from ..i18n import _ -from ..error import DictConsistencyError, display_xmlfiles +from rougail.utils import load_modules +from rougail.i18n import _ +from rougail.error import DictConsistencyError, display_xmlfiles INTERNAL_FUNCTIONS = ['valid_enum', 'valid_in_network', 'valid_differ', 'valid_entier'] -class CheckAnnotator(TargetAnnotator, ParamAnnotator): +class Annotator(TargetAnnotator, ParamAnnotator): """Annotate check """ + level = 40 def __init__(self, objectspace, eosfunc_file, + *args, ): if not hasattr(objectspace.space, 'constraints') or \ not hasattr(objectspace.space.constraints, 'check'): diff --git a/src/rougail/annotator/condition.py b/src/rougail/annotator/condition.py index f8f6f8fc..b31d8183 100644 --- a/src/rougail/annotator/condition.py +++ b/src/rougail/annotator/condition.py @@ -27,19 +27,21 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from typing import List -from ..i18n import _ -from ..error import DictConsistencyError +from rougail.i18n import _ +from rougail.error import DictConsistencyError -from .target import TargetAnnotator -from .param import ParamAnnotator -from .variable import Walk +from rougail.annotator.target import TargetAnnotator +from rougail.annotator.param import ParamAnnotator +from rougail.annotator.variable import Walk -class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk): +class Annotator(TargetAnnotator, ParamAnnotator, Walk): """Annotate condition """ + level = 50 def __init__(self, objectspace, + *args, ): self.objectspace = objectspace self.force_service_value = {} diff --git a/src/rougail/annotator/family.py b/src/rougail/annotator/family.py index 45f4e1b9..3006b7b9 100644 --- a/src/rougail/annotator/family.py +++ b/src/rougail/annotator/family.py @@ -24,9 +24,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -from ..i18n import _ -from ..error import DictConsistencyError -from .variable import Walk +from rougail.i18n import _ +from rougail.error import DictConsistencyError +from rougail.annotator.variable import Walk class Mode: # pylint: disable=R0903 @@ -43,11 +43,13 @@ class Mode: # pylint: disable=R0903 return other.level < self.level -class FamilyAnnotator(Walk): +class Annotator(Walk): """Annotate family """ + level = 80 def __init__(self, objectspace, + *args, ): self.objectspace = objectspace if not hasattr(self.objectspace.space, 'variables'): @@ -74,6 +76,7 @@ class FamilyAnnotator(Walk): def remove_empty_families(self) -> None: """Remove all families without any variable """ + #FIXME pas sous family for families in self.objectspace.space.variables.values(): removed_families = [] for family_name, family in families.variable.items(): diff --git a/src/rougail/annotator/fill.py b/src/rougail/annotator/fill.py index 6d002767..47aed614 100644 --- a/src/rougail/annotator/fill.py +++ b/src/rougail/annotator/fill.py @@ -24,28 +24,30 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -from ..utils import load_modules -from ..i18n import _ -from ..error import DictConsistencyError +from rougail.utils import load_modules +from rougail.i18n import _ +from rougail.error import DictConsistencyError -from .target import TargetAnnotator -from .param import ParamAnnotator +from rougail.annotator.target import TargetAnnotator +from rougail.annotator.param import ParamAnnotator CALC_MULTI = ('calc_value', 'calc_list', 'get_range', 'calc_val_first_value', 'unbound_filename') -class FillAnnotator(TargetAnnotator, ParamAnnotator): +class Annotator(TargetAnnotator, ParamAnnotator): """Fill annotator """ + level = 60 def __init__(self, objectspace, eosfunc_file, + *args, ): - self.objectspace = objectspace if not hasattr(objectspace.space, 'constraints') or \ - not hasattr(self.objectspace.space.constraints, 'fill'): + not hasattr(objectspace.space.constraints, 'fill'): return + self.objectspace = objectspace self.functions = dir(load_modules(eosfunc_file)) self.functions.extend(self.objectspace.rougailconfig['internal_functions']) self.target_is_uniq = True @@ -68,12 +70,11 @@ class FillAnnotator(TargetAnnotator, ParamAnnotator): """valid and manage """ for fill in self.objectspace.space.constraints.fill: + # test if the function exists + if fill.name not in self.functions: + msg = _(f'cannot find fill function "{fill.name}"') + raise DictConsistencyError(msg, 25, fill.xmlfiles) for target in fill.target: - # test if the function exists - if fill.name not in self.functions: - msg = _(f'cannot find fill function "{fill.name}"') - raise DictConsistencyError(msg, 25, fill.xmlfiles) - # create an object value value = self.objectspace.value(fill.xmlfiles) value.type = 'calculation' @@ -87,7 +88,6 @@ class FillAnnotator(TargetAnnotator, ParamAnnotator): target.name.default = value else: target.name.value = [value] - # manage params if hasattr(fill, 'param') and fill.param: value.param = fill.param diff --git a/src/rougail/annotator/group.py b/src/rougail/annotator/group.py index 00b1f25e..884dce32 100644 --- a/src/rougail/annotator/group.py +++ b/src/rougail/annotator/group.py @@ -24,16 +24,18 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -from ..i18n import _ -from ..error import DictConsistencyError -from ..utils import normalize_family +from rougail.i18n import _ +from rougail.error import DictConsistencyError +from rougail.utils import normalize_family -class GroupAnnotator: +class Annotator: """Annotate group """ + level = 10 def __init__(self, objectspace, + *args, ): self.objectspace = objectspace if not hasattr(self.objectspace.space, 'constraints') or \ diff --git a/src/rougail/annotator/param.py b/src/rougail/annotator/param.py index f93c0fc5..f261505a 100644 --- a/src/rougail/annotator/param.py +++ b/src/rougail/annotator/param.py @@ -29,10 +29,10 @@ try: except ModuleNotFoundError: import tiramisu -from .variable import CONVERT_OPTION +from rougail.annotator.variable import CONVERT_OPTION -from ..i18n import _ -from ..error import DictConsistencyError +from rougail.i18n import _ +from rougail.error import DictConsistencyError class ParamAnnotator: diff --git a/src/rougail/annotator/property.py b/src/rougail/annotator/property.py index 12a3ee2d..24feadc9 100644 --- a/src/rougail/annotator/property.py +++ b/src/rougail/annotator/property.py @@ -24,19 +24,23 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -from ..i18n import _ -from ..error import DictConsistencyError -from .variable import Walk +from rougail.i18n import _ +from rougail.error import DictConsistencyError +from rougail.annotator.variable import Walk PROPERTIES = ('hidden', 'frozen', 'force_default_on_freeze', 'force_store_value', 'disabled', 'mandatory') -class PropertyAnnotator(Walk): +class Annotator(Walk): """Annotate properties """ - def __init__(self, objectspace): + level = 90 + def __init__(self, + objectspace, + *args + ) -> None: self.objectspace = objectspace if hasattr(self.objectspace.space, 'services'): self.convert_services() diff --git a/src/rougail/annotator/service.py b/src/rougail/annotator/service.py index 7b8a3d34..de14cf9b 100644 --- a/src/rougail/annotator/service.py +++ b/src/rougail/annotator/service.py @@ -27,9 +27,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from os.path import basename from typing import Tuple -from ..i18n import _ -from ..utils import normalize_family -from ..error import DictConsistencyError +from rougail.i18n import _ +from rougail.utils import normalize_family +from rougail.error import DictConsistencyError # a object's attribute has some annotations # that shall not be present in the exported (flatened) XML ERASED_ATTRIBUTES = ('redefine', 'exists', 'optional', 'remove_check', 'namespace', @@ -39,7 +39,7 @@ ERASED_ATTRIBUTES = ('redefine', 'exists', 'optional', 'remove_check', 'namespac ALLOW_ATTRIBUT_NOT_MANAGE = ['file'] -class ServiceAnnotator: +class Annotator: """Manage service's object for example:: @@ -49,7 +49,11 @@ class ServiceAnnotator: """ - def __init__(self, objectspace): + level = 20 + def __init__(self, + objectspace, + *args, + ) -> None: self.objectspace = objectspace self.uniq_overrides = [] if 'network_type' not in self.objectspace.types: diff --git a/src/rougail/annotator/target.py b/src/rougail/annotator/target.py index b3ed69dc..0639d61d 100644 --- a/src/rougail/annotator/target.py +++ b/src/rougail/annotator/target.py @@ -24,8 +24,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -from ..i18n import _ -from ..error import DictConsistencyError +from rougail.i18n import _ +from rougail.error import DictConsistencyError class TargetAnnotator: diff --git a/src/rougail/annotator/value.py b/src/rougail/annotator/value.py index 7496f47c..3697fd29 100644 --- a/src/rougail/annotator/value.py +++ b/src/rougail/annotator/value.py @@ -24,16 +24,18 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -from .variable import Walk +from rougail.annotator.variable import Walk -from ..i18n import _ -from ..error import DictConsistencyError +from rougail.i18n import _ +from rougail.error import DictConsistencyError -class ValueAnnotator(Walk): # pylint: disable=R0903 +class Annotator(Walk): # pylint: disable=R0903 """Annotate value """ + level = 70 def __init__(self, objectspace, + *args, ) -> None: if not hasattr(objectspace.space, 'variables'): return diff --git a/src/rougail/annotator/variable.py b/src/rougail/annotator/variable.py index b6c7cbd3..e52783fb 100644 --- a/src/rougail/annotator/variable.py +++ b/src/rougail/annotator/variable.py @@ -25,9 +25,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -from ..i18n import _ -from ..error import DictConsistencyError -from ..objspace import convert_boolean +from rougail.i18n import _ +from rougail.error import DictConsistencyError +from rougail.objspace import convert_boolean CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int), @@ -111,11 +111,13 @@ class Walk: yield from self._get_families(fam) -class VariableAnnotator(Walk): # pylint: disable=R0903 +class Annotator(Walk): # pylint: disable=R0903 """Annotate variable """ + level = 30 def __init__(self, objectspace, + *args, ): if not hasattr(objectspace.space, 'variables'): return diff --git a/src/rougail/config.py b/src/rougail/config.py index 7e0abd2f..23721373 100644 --- a/src/rougail/config.py +++ b/src/rougail/config.py @@ -43,6 +43,7 @@ RougailConfig = {'dictionaries_dir': [join(ROUGAILROOT, 'dictionaries')], 'variable_namespace': 'rougail', 'auto_freeze_variable': 'server_deployed', 'internal_functions': [], + 'extra_annotators': [], 'modes_level': ['basic', 'normal', 'expert'], 'default_family_mode': 'basic', 'default_variable_mode': 'normal', diff --git a/src/rougail/data/rougail.dtd b/src/rougail/data/rougail.dtd index 5c7a7713..8612f48d 100644 --- a/src/rougail/data/rougail.dtd +++ b/src/rougail/data/rougail.dtd @@ -83,7 +83,7 @@ - + @@ -102,7 +102,7 @@ - +