feat: update upgrade module

This commit is contained in:
egarette@silique.fr 2024-09-30 17:58:14 +02:00
parent d2195d31a9
commit e518abb734
490 changed files with 809 additions and 2437 deletions

View file

@ -1,4 +1,4 @@
"""Update Rougail XML file to new version """Update Rougail structure file to new version
Cadoles (http://www.cadoles.com) Cadoles (http://www.cadoles.com)
Copyright (C) 2021 Copyright (C) 2021
@ -23,7 +23,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
""" """
from os import listdir, makedirs from os import listdir
from os.path import basename, isdir, isfile, join from os.path import basename, isdir, isfile, join
from typing import Any, List, Optional, Tuple from typing import Any, List, Optional, Tuple
@ -38,11 +38,11 @@ from json import dumps
from ruamel.yaml import YAML from ruamel.yaml import YAML
from pathlib import Path from pathlib import Path
from .config import RougailConfig from ..config import RougailConfig
from .error import UpgradeError from ..error import UpgradeError
from .i18n import _ from ..i18n import _
from .object_model import CONVERT_OPTION from ..object_model import CONVERT_OPTION
from .utils import normalize_family from ..utils import normalize_family
VERSIONS = ["0.10", "1.0", "1.1"] VERSIONS = ["0.10", "1.0", "1.1"]
@ -63,7 +63,7 @@ class upgrade_010_to_10:
xmlsrc: str, xmlsrc: str,
) -> None: ) -> None:
self.xmlsrc = xmlsrc self.xmlsrc = xmlsrc
self.paths = {"family": {}, "variable": {}} self.paths = {"family": {}, "variable": {}, 'dynamic': {}}
self.lists = { self.lists = {
"service": {}, "service": {},
"ip": {}, "ip": {},
@ -71,7 +71,7 @@ class upgrade_010_to_10:
"file": {}, "file": {},
} }
self.flatten_paths = {"family": {}, "variable": {}} self.flatten_paths = {"family": {}, "variable": {}}
self.variables = self.parse_variables(dico, namespace) self.variables = self.parse_variables(dico, namespace, namespace, root=True)
self.parse_variables_with_path() self.parse_variables_with_path()
self.parse_services(dico) self.parse_services(dico)
self.parse_constraints(dico) self.parse_constraints(dico)
@ -80,13 +80,20 @@ class upgrade_010_to_10:
self, self,
family: dict, family: dict,
sub_path: str, sub_path: str,
true_sub_path: str,
*,
root: bool=False,
is_dynamic: bool=False,
) -> dict: ) -> dict:
new_families = {} new_families = {}
if root:
new_families['version'] = None
if "variables" in family: if "variables" in family:
for subelt in family["variables"]: for subelt in family["variables"]:
for typ, obj in subelt.items(): for typ, obj in subelt.items():
for subobj in obj: for subobj in obj:
getattr(self, f"convert_{typ}")(subobj, new_families, sub_path) local_is_dynamic = is_dynamic or subobj.get('dynamic') is not None
getattr(self, f"convert_{typ}")(subobj, new_families, sub_path, true_sub_path, local_is_dynamic)
family.pop("variables") family.pop("variables")
return new_families return new_families
@ -95,9 +102,17 @@ class upgrade_010_to_10:
family: dict, family: dict,
new_families: dict, new_families: dict,
sub_path: str, sub_path: str,
true_sub_path: str,
is_dynamic: bool,
) -> None: ) -> None:
# name is the key, do not let it in values # name is the key, do not let it in values
name = family.pop("name") name = family.pop("name")
if true_sub_path:
true_sub_path = true_sub_path + "." + name
else:
true_sub_path = name
if is_dynamic:
name += '{{ suffix }}'
if sub_path: if sub_path:
sub_path = sub_path + "." + name sub_path = sub_path + "." + name
else: else:
@ -111,7 +126,7 @@ class upgrade_010_to_10:
if typ == "dynamic": if typ == "dynamic":
family["variable"] = self.get_variable_path(value) family["variable"] = self.get_variable_path(value)
# add sub families and sub variables # add sub families and sub variables
sub_families = self.parse_variables(family, sub_path) sub_families = self.parse_variables(family, sub_path, true_sub_path, is_dynamic=is_dynamic)
for sub_name, sub_family in sub_families.copy().items(): for sub_name, sub_family in sub_families.copy().items():
if sub_name not in family: if sub_name not in family:
continue continue
@ -127,12 +142,23 @@ class upgrade_010_to_10:
variable: dict, variable: dict,
new_families: dict, new_families: dict,
sub_path: str, sub_path: str,
true_sub_path: str,
is_dynamic: bool,
) -> dict: ) -> dict:
name = variable.pop("name") name = variable.pop("name")
if is_dynamic:
if true_sub_path:
true_sub_path = true_sub_path + "." + name
else:
true_sub_path = name
self.flatten_paths["variable"][name] = true_sub_path
name += '{{ suffix }}'
if sub_path: if sub_path:
sub_path = sub_path + "." + name sub_path = sub_path + "." + name
else: else:
sub_path = name sub_path = name
if is_dynamic:
self.paths['dynamic'][true_sub_path] = sub_path
new_families[name] = variable new_families[name] = variable
self.flatten_paths["variable"][name] = sub_path self.flatten_paths["variable"][name] = sub_path
self.paths["variable"][sub_path] = variable self.paths["variable"][sub_path] = variable
@ -172,24 +198,32 @@ class upgrade_010_to_10:
)(test) )(test)
) )
variable["test"] = tests variable["test"] = tests
if variable.get('mandatory', False):
del variable["mandatory"]
CONVERT_TYPE = {'filename': 'unix_filename',
'password': 'secret',
}
if variable.get('type') in CONVERT_TYPE:
variable['type'] = CONVERT_TYPE[variable['type']]
def parse_variables_with_path(self): def parse_variables_with_path(self):
for variable in self.paths["variable"].values(): for variable in self.paths["variable"].values():
multi = variable.get('multi', False)
if "value" in variable: if "value" in variable:
default = variable.pop("value") default = variable.pop("value")
if default is not None: if default is not None:
if not variable.get("multi", False) and len(default) == 1: if not multi and len(default) == 1:
variable["default"] = self.get_value(default[0]) variable["default"] = self.get_value(default[0], multi)
else: else:
variable["default"] = [ variable["default"] = [
self.get_value(value) for value in default self.get_value(value, multi) for value in default
] ]
if "choice" in variable: if "choice" in variable:
if not variable["choice"]: if not variable["choice"]:
variable["choices"] = variable.pop("choice") variable["choices"] = variable.pop("choice")
else: else:
variable["choices"] = [ variable["choices"] = [
self.get_value(choice) for choice in variable.pop("choice") self.get_value(choice, multi) for choice in variable.pop("choice")
] ]
def parse_services( def parse_services(
@ -305,15 +339,32 @@ class upgrade_010_to_10:
apply_on_fallback = False apply_on_fallback = False
source = self.get_variable_path(condition["source"]) source = self.get_variable_path(condition["source"])
if not source: if not source:
source = f'__{condition["source"]}' source = condition["source"]
name = condition.pop("name") name = condition.pop("name")
prop = name.split("_", 1)[0] prop = name.split("_", 1)[0]
multi = False
for target in condition["target"]:
typ = target.get("type", "variable")
if typ == "variable":
variable_path = self.get_variable_path(target["text"])
if variable_path is None:
continue
variable = self.paths["variable"][variable_path]
if variable.get('multi', False):
multi = True
if apply_on_fallback: if apply_on_fallback:
condition_value = True condition_value = True
else: else:
if "{{ suffix }}" in source:
force_param = {'__var': source}
source = '__var'
else:
force_param = None
condition_value = self.params_condition_to_jinja( condition_value = self.params_condition_to_jinja(
prop, source, condition["param"], name.endswith("if_in") prop, source, condition["param"], name.endswith("if_in"), multi
) )
if force_param:
condition_value.setdefault('params', {}).update(force_param)
for target in condition["target"]: for target in condition["target"]:
typ = target.get("type", "variable") typ = target.get("type", "variable")
if typ == "variable": if typ == "variable":
@ -366,7 +417,7 @@ class upgrade_010_to_10:
check["param"] = [ check["param"] = [
{"text": variable_path, "type": "variable"} {"text": variable_path, "type": "variable"}
] + check.get("param", []) ] + check.get("param", [])
check_value = self.convert_param_function(check) check_value = self.convert_param_function(check, variable.get('multi', False))
variable.setdefault("validators", []).append(check_value) variable.setdefault("validators", []).append(check_value)
def parse_fill( def parse_fill(
@ -376,17 +427,22 @@ class upgrade_010_to_10:
for target in fill.pop("target"): for target in fill.pop("target"):
params = [] params = []
variable_path = self.get_variable_path(target["text"]) variable_path = self.get_variable_path(target["text"])
if variable_path is None: if variable_path in self.paths["dynamic"]:
continue variable_path = self.paths["dynamic"][variable_path]
variable = self.paths["variable"][variable_path] if variable_path in self.paths["variable"]:
if fill.get("type") == "jinja": variable = self.paths["variable"][variable_path]
fill_value = { if fill.get("type") == "jinja":
"type": "jinja", fill_value = {
"jinja": fill["name"], "type": "jinja",
} "jinja": fill["name"],
}
else:
fill_value = self.convert_param_function(fill, variable.get('multi', False))
variable["default"] = fill_value
if variable.get('mandatory') is False:
del variable['mandatory']
else: else:
fill_value = self.convert_param_function(fill) raise Exception(f'cannot set fill to unknown variable "{variable_path}"')
variable["default"] = fill_value
def params_condition_to_jinja( def params_condition_to_jinja(
self, self,
@ -394,6 +450,7 @@ class upgrade_010_to_10:
path: str, path: str,
params: List[dict], params: List[dict],
if_in: bool, if_in: bool,
multi: bool,
) -> str: ) -> str:
new_params = {} new_params = {}
jinja = "{% if " jinja = "{% if "
@ -401,7 +458,7 @@ class upgrade_010_to_10:
if idx: if idx:
jinja += " or " jinja += " or "
new_param, value = self.get_jinja_param_and_value(param) new_param, value = self.get_jinja_param_and_value(param, multi)
if value: if value:
jinja += path + " == " + value jinja += path + " == " + value
if new_param: if new_param:
@ -421,10 +478,11 @@ class upgrade_010_to_10:
def get_value( def get_value(
self, self,
param: dict, param: dict,
multi: bool,
) -> Any: ) -> Any:
typ = param.get("type", "string") typ = param.get("type", "string")
if typ == "string": if typ == "string":
value = param["text"] value = param.get("text")
elif typ == "number": elif typ == "number":
value = int(param["text"]) value = int(param["text"])
elif typ == "nil": elif typ == "nil":
@ -446,7 +504,7 @@ class upgrade_010_to_10:
if "propertyerror" in param: if "propertyerror" in param:
value["propertyerror"] = param["propertyerror"] value["propertyerror"] = param["propertyerror"]
elif typ == "function": elif typ == "function":
value = self.convert_param_function(param) value = self.convert_param_function(param, multi)
elif typ == "information": elif typ == "information":
value = { value = {
"type": "information", "type": "information",
@ -464,10 +522,11 @@ class upgrade_010_to_10:
def get_jinja_param_and_value( def get_jinja_param_and_value(
self, self,
param, param,
multi: bool,
) -> Tuple[list, Any]: ) -> Tuple[list, Any]:
new_param = None new_param = None
typ = param.get("type", "string") typ = param.get("type", "string")
value = self.get_value(param) value = self.get_value(param, multi)
if isinstance(value, dict): if isinstance(value, dict):
if typ == "information": if typ == "information":
key = normalize_family(value["information"]) key = normalize_family(value["information"])
@ -475,17 +534,25 @@ class upgrade_010_to_10:
attr_name = f'{value["variable"]}.{key}' attr_name = f'{value["variable"]}.{key}'
else: else:
attr_name = key attr_name = key
attr_name = f"__information.{attr_name}" attr_name = f"__information_{attr_name}"
new_param = {attr_name: value} new_param = {attr_name: value}
value = attr_name value = attr_name
elif typ in ["index", "suffix"]: elif typ in ["index", "suffix"]:
attr_name = f"__{typ}" if 'name' in value:
new_param = {attr_name: value} attr_name = value['name']
else:
attr_name = f"__{typ}"
new_param = {attr_name: {"type": typ}}
value = attr_name value = attr_name
elif "propertyerror" in param or "optional" in param: elif "propertyerror" in param or "optional" in param:
attr_name = value["variable"] attr_name = value["variable"]
new_param = {attr_name: value} new_param = {attr_name: value}
value = value[typ] value = value[typ]
elif "{{ suffix }}" in value[typ]:
path = value[typ]
attr_name = path.split('.')[-1][:-12] # remove {{ suffix }}
new_param = {attr_name: value}
value = attr_name
else: else:
value = value[typ] value = value[typ]
if not value: if not value:
@ -497,22 +564,35 @@ class upgrade_010_to_10:
def convert_param_function( def convert_param_function(
self, self,
param: dict, param: dict,
multi: bool,
) -> str: ) -> str:
text = param["name"] text = param["name"]
params = {} params = {}
# multi = False
if "param" in param and param["param"]: if "param" in param and param["param"]:
if text == 'calc_value' and len(param["param"]) == 1 and isinstance(param["param"][0], dict) and param["param"][0].get('type') == 'variable' and param["param"][0].get("text"):
value = param["param"][0]["text"]
path = self.get_variable_path(value)
if not path:
path = value
ret = {"type": "variable", "variable": path}
if 'optional' in param["param"][0]:
ret['optional'] = param["param"][0]["optional"]
return ret
first, *others = param["param"] first, *others = param["param"]
new_param, first = self.get_jinja_param_and_value(first) new_param, first = self.get_jinja_param_and_value(first, multi)
text = f"{first} | {text}" text = f"{first} | {text}"
if new_param: if new_param:
params |= new_param params |= new_param
if others: if others:
values = [] values = []
for param in others: for param in others:
new_param, value = self.get_jinja_param_and_value(param) new_param, value = self.get_jinja_param_and_value(param, multi)
if new_param: if new_param:
params |= new_param params |= new_param
if "name" in param: if "name" in param:
if param["name"] == "multi" and value == "true":
multi = True
values.append(f'{param["name"]}={value}') values.append(f'{param["name"]}={value}')
else: else:
values.append(value) values.append(value)
@ -521,7 +601,12 @@ class upgrade_010_to_10:
text += ")" text += ")"
else: else:
text += "()" text += "()"
text = "{{ " + text + " }}" if not multi:
text = "{{ " + text + " }}"
else:
text = """{% for __variable in """ + text + """ %}
{{ __variable }}
{% endfor %}"""
ret = {"type": "jinja", "jinja": text} ret = {"type": "jinja", "jinja": text}
if params: if params:
ret["params"] = params ret["params"] = params
@ -536,8 +621,10 @@ class upgrade_010_to_10:
and path in self.flatten_paths["variable"] and path in self.flatten_paths["variable"]
): ):
path = self.flatten_paths["variable"][path] path = self.flatten_paths["variable"][path]
if path in self.paths["dynamic"]:
path = self.paths["dynamic"][path]
if path not in self.paths["variable"]: if path not in self.paths["variable"]:
return return path
return path return path
def get_family_path( def get_family_path(
@ -569,43 +656,38 @@ class RougailUpgrade:
rougailconfig = RougailConfig rougailconfig = RougailConfig
self.rougailconfig = rougailconfig self.rougailconfig = rougailconfig
def load_dictionaries( def run(
self, self,
dstfolder: str,
services_dstfolder: Optional[str] = None,
extra_dstfolder: Optional[str] = None,
): ):
if extra_dstfolder is None: for dict_dir, dest_dir in zip(self.rougailconfig["main_dictionaries"], self.rougailconfig["upgrade_options.main_dictionaries"]):
extra_dstfolder = dstfolder
dict_dirs = self.rougailconfig["main_dictionaries"]
if not isinstance(dict_dirs, list):
dict_dirs = [dict_dirs]
for dict_dir in dict_dirs:
self._load_dictionaries( self._load_dictionaries(
dict_dir, dict_dir,
dstfolder, dest_dir,
services_dstfolder,
normalize_family(self.rougailconfig["main_namespace"]), normalize_family(self.rougailconfig["main_namespace"]),
) )
for namespace, extra_dirs in self.rougailconfig["extra_dictionaries"].items(): if self.rougailconfig['main_namespace']:
extra_dstsubfolder = join(extra_dstfolder, namespace) if self.rougailconfig["extra_dictionaries"]:
if not isdir(extra_dstsubfolder): dst_extra_dir = self.rougailconfig["upgrade_options.extra_dictionary"]
makedirs(extra_dstsubfolder) for namespace, extra_dirs in self.rougailconfig["extra_dictionaries"].items():
for extra_dir in extra_dirs: extra_dstsubfolder = Path(dst_extra_dir) / namespace
self._load_dictionaries( if not extra_dstsubfolder.is_dir():
extra_dir, extra_dstsubfolder.mkdir()
extra_dstsubfolder, for extra_dir in extra_dirs:
None, self._load_dictionaries(
normalize_family(namespace), str(extra_dir),
) str(extra_dstsubfolder),
normalize_family(namespace),
)
def _load_dictionaries( def _load_dictionaries(
self, self,
srcfolder: str, srcfolder: str,
dstfolder: str, dstfolder: Optional[str],
services_dstfolder: Optional[str],
namespace: str, namespace: str,
) -> None: ) -> None:
if dstfolder is None:
dstfolder = srcfolder
Path(dstfolder).mkdir(parents=True, exist_ok=True)
filenames = [ filenames = [
filename filename
for filename in listdir(srcfolder) for filename in listdir(srcfolder)
@ -614,18 +696,8 @@ class RougailUpgrade:
filenames.sort() filenames.sort()
for filename in filenames: for filename in filenames:
xmlsrc = Path(srcfolder) / Path(filename) xmlsrc = Path(srcfolder) / Path(filename)
ymlfile = filename[:-3] + "yml"
xmldst = Path(dstfolder) / Path(ymlfile) ymldst = Path(dstfolder) / (Path(filename).stem + '.yml')
if xmldst.is_file():
raise Exception(
f'cannot update "{xmlsrc}" destination file "{xmldst}" already exists'
)
if services_dstfolder:
ymldst_services = Path(services_dstfolder) / ymlfile
if ymldst_services.is_file():
raise Exception(
f'cannot update "{xmlsrc}" destination file "{ymldst_services}" already exists'
)
if filename.endswith(".xml"): if filename.endswith(".xml"):
if parse is None: if parse is None:
raise Exception("XML module is not installed") raise Exception("XML module is not installed")
@ -640,7 +712,7 @@ class RougailUpgrade:
) )
ext = "xml" ext = "xml"
else: else:
with xmlsrc.open() as xml_fh: with xmlsrc.open() as file_fh:
root = YAML(typ="safe").load(file_fh) root = YAML(typ="safe").load(file_fh)
search_function_name = get_function_name(str(root["version"])) search_function_name = get_function_name(str(root["version"]))
ext = "yml" ext = "yml"
@ -660,24 +732,23 @@ class RougailUpgrade:
root_services = root_services_ root_services = root_services_
if function_version == search_function_name: if function_version == search_function_name:
function_found = True function_found = True
if root: if root != {'version': None}:
root["version"] = version root["version"] = float(version)
xmldst.parent.mkdir(parents=True, exist_ok=True) with ymldst.open("w") as ymlfh:
with xmldst.open("w") as ymlfh:
yaml = YAML() yaml = YAML()
yaml.dump( yaml.dump(
root, root,
xmldst,
)
if root_services and services_dstfolder:
root_services["version"] = version
ymldst_services.parent.mkdir(parents=True, exist_ok=True)
with ymldst_services.open("w") as ymlfh:
yaml = YAML()
yaml.dump(
root_services,
ymlfh, ymlfh,
) )
# if root_services and services_dstfolder:
# root_services["version"] = version
# ymldst_services.parent.mkdir(parents=True, exist_ok=True)
# with ymldst_services.open("w") as ymlfh:
# yaml = YAML()
# yaml.dump(
# root_services,
# ymlfh,
# )
def _attribut_to_bool(self, variable): def _attribut_to_bool(self, variable):
for prop in [ for prop in [
@ -833,23 +904,47 @@ class RougailUpgrade:
return dico return dico
def _update_1_1(self, root): def _update_1_1(self, root):
if not isinstance(root, dict): new_root = {}
return update_root = False
# migrate dynamic family
if (
("variable" in root and isinstance(root["variable"], str))
or ("_variable" in root and isinstance(root["_variable"], str))
) and (
("_type" in root and root["_type"] == "dynamic")
or ("type" in root and root["type"] == "dynamic")
):
root["dynamic"] = {
"type": "variable",
"variable": root.pop("variable"),
"propertyerror": False,
}
for key, value in root.items(): for key, value in root.items():
new_root[key] = value
if not isinstance(value, dict):
continue
# migrate dynamic family
if (
("variable" in value and isinstance(value["variable"], str))
or ("_variable" in value and isinstance(value["_variable"], str))
) and (
("_type" in value and value["_type"] == "dynamic")
or ("type" in value and value["type"] == "dynamic")
):
value["dynamic"] = {
"type": "variable",
"variable": value.pop("variable"),
"propertyerror": False,
}
if '{{ suffix }}' not in key:
new_root[key + '{{ suffix }}'] = new_root.pop(key)
update_root = True
self._update_1_1(value) self._update_1_1(value)
for typ, obj in {'boolean': bool,
'number': int,
'string': str,
'float': float,
}.items():
if value.get('type') == typ:
default = value.get('default')
if default is None or default == []:
continue
if isinstance(default, obj):
del value['type']
elif isinstance(default, list) and isinstance(default[0], obj):
del value['type']
if value.get('multi') and isinstance(value.get('default'), list):
del value['multi']
if update_root:
root.clear()
root.update(new_root)
def update_1_1( def update_1_1(
self, self,
@ -877,7 +972,7 @@ class RougailUpgrade:
objects = root.find(typ) objects = root.find(typ)
if objects is None: if objects is None:
objects = [] objects = []
new_objects = self._xml_to_yaml(objects, typ, variables, "") new_objects = self._xml_to_yaml(objects, typ, variables, namespace)
if new_objects[typ]: if new_objects[typ]:
new_root.update(new_objects) new_root.update(new_objects)
else: else:
@ -927,7 +1022,6 @@ class RougailUpgrade:
if not has_value: if not has_value:
value = SubElement(variable, "value") value = SubElement(variable, "value")
value.text = choices[0] value.text = choices[0]
variable.attrib["mandatory"] = "True"
# convert group to leadership # convert group to leadership
groups = [] groups = []

View file

@ -0,0 +1,25 @@
---
version: '1.1'
var: # a suffix variable
- val1
- val2
"my_dyn_family_{{ suffix }}":
description: a dynamic family
dynamic:
variable: _.var
var:
description: a variable inside a dynamic family
default:
type: suffix
mandatory: false
var2:
description: a variable
multi: true
default:
jinja: |-
{%- for v in var %}
{{ v }}
{%- endfor -%}
params:
var:
variable: rougail.my_dyn_family_{{ suffix }}.var

View file

@ -0,0 +1,24 @@
{
"rougail.var": {
"owner": "default",
"value": [
"val1",
"val2"
]
},
"rougail.my_dyn_family_val1.var": {
"owner": "default",
"value": "val1"
},
"rougail.my_dyn_family_val2.var": {
"owner": "default",
"value": "val2"
},
"rougail.var2": {
"owner": "default",
"value": [
"val1",
"val2"
]
}
}

View file

@ -0,0 +1,12 @@
{
"rougail.var": [
"val1",
"val2"
],
"rougail.my_dyn_family_val1.var": "val1",
"rougail.my_dyn_family_val2.var": "val2",
"rougail.var2": [
"val1",
"val2"
]
}

View file

@ -0,0 +1,24 @@
{
"rougail.var": {
"owner": "default",
"value": [
"val1",
"val2"
]
},
"rougail.my_dyn_family_val1.var": {
"owner": "default",
"value": "val1"
},
"rougail.my_dyn_family_val2.var": {
"owner": "default",
"value": "val2"
},
"rougail.var2": {
"owner": "default",
"value": [
"val1",
"val2"
]
}
}

View file

@ -0,0 +1,15 @@
from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['default_rougail.var2'] = "{%- for v in var %}\n{{ v }}\n{%- endfor -%}"
option_2 = StrOption(name="var", doc="a suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
option_4 = StrOption(name="var", doc="a variable inside a dynamic family", default=Calculation(func['calc_value'], Params((ParamSuffix()))), properties=frozenset({"standard"}), informations={'type': 'string'})
optiondescription_3 = ConvertDynOptionDescription(name="my_dyn_family_{{ suffix }}", doc="a dynamic family", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_2)))), children=[option_4], properties=frozenset({"standard"}))
option_5 = StrOption(name="var2", doc="a variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['tests/dictionaries/60_5family_dynamic_variable_outside_jinja/dictionaries/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("rougail.var2"), 'var': ParamOption(option_4)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, optiondescription_3, option_5], properties=frozenset({"standard"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -0,0 +1,23 @@
from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
dict_env['default_1.rougail.var2'] = "{%- for v in var %}\n{{ v }}\n{%- endfor -%}"
dict_env['default_2.rougail.var2'] = "{%- for v in var %}\n{{ v }}\n{%- endfor -%}"
option_3 = StrOption(name="var", doc="a suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
option_5 = StrOption(name="var", doc="a variable inside a dynamic family", default=Calculation(func['calc_value'], Params((ParamSuffix()))), properties=frozenset({"standard"}), informations={'type': 'string'})
optiondescription_4 = ConvertDynOptionDescription(name="my_dyn_family_{{ suffix }}", doc="a dynamic family", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_3)))), children=[option_5], properties=frozenset({"standard"}))
option_6 = StrOption(name="var2", doc="a variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['tests/dictionaries/60_5family_dynamic_variable_outside_jinja/dictionaries/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.var2"), 'var': ParamOption(option_5)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, optiondescription_4, option_6], properties=frozenset({"standard"}))
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
option_9 = StrOption(name="var", doc="a suffix variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
option_11 = StrOption(name="var", doc="a variable inside a dynamic family", default=Calculation(func['calc_value'], Params((ParamSuffix()))), properties=frozenset({"standard"}), informations={'type': 'string'})
optiondescription_10 = ConvertDynOptionDescription(name="my_dyn_family_{{ suffix }}", doc="a dynamic family", suffixes=Calculation(func['calc_value'], Params((ParamOption(option_9)))), children=[option_11], properties=frozenset({"standard"}))
option_12 = StrOption(name="var2", doc="a variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['tests/dictionaries/60_5family_dynamic_variable_outside_jinja/dictionaries/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.var2"), 'var': ParamOption(option_11)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[option_9, optiondescription_10, option_12], properties=frozenset({"standard"}))
optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8], properties=frozenset({"standard"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_7])

View file

@ -1,2 +0,0 @@
tata.service: {}
version: '1.1'

View file

@ -1,10 +1,9 @@
version: 1.1
server_deployed: server_deployed:
type: boolean type: boolean
general: general:
description: général description: général
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: No change description: No change
auto_save: true auto_save: true
default: non default: non
version: '1.1'

View file

@ -1,11 +1,10 @@
version: 1.1
server_deployed: server_deployed:
type: boolean type: boolean
general: general:
description: général description: général
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: No change description: No change
auto_save: true auto_save: true
mode: advanced mode: advanced
default: non default: non
version: '1.1'

View file

@ -1,8 +1,7 @@
version: 1.1
general: general:
description: général description: général
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: No change description: No change
hidden: true hidden: true
default: non default: non
version: '1.1'

View file

@ -1,10 +1,9 @@
version: 1.1
general: general:
description: général description: général
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: No change description: No change
hidden: true hidden: true
default: non default: non
without_type: without_type:
default: non default: non
version: '1.1'

View file

@ -1,8 +1,7 @@
version: 1.1
general: general:
description: général description: général
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: No change description: No change
hidden: true hidden: true
default: non default: non
version: '1.1'

View file

@ -1,3 +1,4 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string type: string
@ -7,7 +8,5 @@ general:
type: jinja type: jinja
jinja: '{{ rougail.general.mode_conteneur_actif1 | calc_val }}' jinja: '{{ rougail.general.mode_conteneur_actif1 | calc_val }}'
mode_conteneur_actif1: mode_conteneur_actif1:
type: string
description: No change description: No change
default: non default: non
version: '1.1'

View file

@ -1,3 +1,4 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string type: string
@ -7,7 +8,5 @@ general:
type: jinja type: jinja
jinja: '{{ rougail.general.mode_conteneur_actif1 }}' jinja: '{{ rougail.general.mode_conteneur_actif1 }}'
mode_conteneur_actif1: mode_conteneur_actif1:
type: string
description: No change description: No change
default: non default: non
version: '1.1'

View file

@ -1,3 +1,4 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string type: string
@ -7,7 +8,5 @@ general:
type: jinja type: jinja
jinja: '{{ rougail.general.mode_conteneur_actif1 }}' jinja: '{{ rougail.general.mode_conteneur_actif1 }}'
mode_conteneur_actif1: mode_conteneur_actif1:
type: string
description: No change description: No change
default: non default: non
version: '1.1'

View file

@ -1,22 +1,19 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string type: string
description: No change description: No change
hidden: true hidden: true
mandatory: false
default: default:
type: jinja type: jinja
jinja: "{% if mode_conteneur_actif1 == 'non' %}non{% else %}oui{% endif %}" jinja: "{% if mode_conteneur_actif1 == 'non' %}non{% else %}oui{% endif %}"
mode_conteneur_actif1: mode_conteneur_actif1:
type: string
description: No change description: No change
default: non default: non
mode_conteneur_actif2: mode_conteneur_actif2:
type: string type: string
description: No change description: No change
hidden: true hidden: true
mandatory: false
default: default:
type: jinja type: jinja
jinja: '{% if mode_conteneur_actif1 == "non" %}oui{% else %}non{% endif %}' jinja: '{% if mode_conteneur_actif1 == "non" %}oui{% else %}non{% endif %}'
version: '1.1'

View file

@ -1,3 +1,4 @@
version: 1.1
general: general:
bool: bool:
type: boolean type: boolean
@ -13,4 +14,3 @@ general:
default: default:
type: jinja type: jinja
jinja: '{% if not rougail.general.bool %}True,False{% else %}False{% endif %}' jinja: '{% if not rougail.general.bool %}True,False{% else %}False{% endif %}'
version: '1.1'

View file

@ -1,15 +1,13 @@
version: 1.1
bool: bool:
type: boolean type: boolean
int1: int1:
type: number type: number
mandatory: false
default: default:
type: jinja type: jinja
jinja: '{% if bool %}1{% else %}2{% endif %}' jinja: '{% if bool %}1{% else %}2{% endif %}'
int2: int2:
type: number type: number
mandatory: false
default: default:
type: jinja type: jinja
jinja: '{% if not bool %}3{% else %}4{% endif %}' jinja: '{% if not bool %}3{% else %}4{% endif %}'
version: '1.1'

View file

@ -1,15 +1,13 @@
version: 1.1
bool: bool:
type: boolean type: boolean
int1: int1:
type: number type: number
mandatory: false
default: default:
type: jinja type: jinja
jinja: '{%set bool1 = bool %}{% if bool1 %}1{% else %}2{% endif %}' jinja: '{%set bool1 = bool %}{% if bool1 %}1{% else %}2{% endif %}'
int2: int2:
type: number type: number
mandatory: false
default: default:
type: jinja type: jinja
jinja: '{%set bool1 = bool %}{% if not bool1 %}3{% else %}4{% endif %}' jinja: '{%set bool1 = bool %}{% if not bool1 %}3{% else %}4{% endif %}'
version: '1.1'

View file

@ -1,3 +1,4 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string type: string
@ -7,7 +8,5 @@ general:
type: jinja type: jinja
jinja: '{{ calc_val() }}' jinja: '{{ calc_val() }}'
mode_conteneur_actif1: mode_conteneur_actif1:
type: string
description: No change description: No change
default: non default: non
version: '1.1'

View file

@ -1,4 +1,4 @@
version: 1.1
server_name: server_name:
type: domainname type: domainname
default: example.net default: example.net
version: '1.1'

View file

@ -1,6 +0,0 @@
test.service:
certificates:
certificate:
authority: authority
owner: example
version: '1.1'

View file

@ -1,7 +1,7 @@
version: 1.1
owner: owner:
type: unix_user type: unix_user
default: example default: example
server_name: server_name:
type: domainname type: domainname
default: example.net default: example.net
version: '1.1'

View file

@ -1,8 +0,0 @@
test.service:
certificates:
certificate:
authority: authority
owner:
name: rougail.owner
type: variable
version: '1.1'

View file

@ -1,6 +1,6 @@
version: 1.1
general: general:
domain: domain:
type: domainname type: domainname
description: Description description: Description
default: my.domain.name default: my.domain.name
version: '1.1'

View file

@ -1,6 +1,5 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
version: '1.1'

View file

@ -1,6 +0,0 @@
test.service:
files:
/etc/file: {}
/etc/file2:
engine: jinja
version: '1.1'

View file

@ -1,6 +1,5 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
version: '1.1'

View file

@ -1,8 +0,0 @@
test.service:
files:
/etc/file: {}
/etc/file2:
engine: jinja
/etc/file3:
disabled: true
version: '1.1'

View file

@ -1,6 +1,5 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
version: '1.1'

View file

@ -1,6 +0,0 @@
test.service:
files:
/etc/file: {}
/etc/file2:
engine: jinja
version: '1.1'

View file

@ -1,6 +1,5 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
version: '1.1'

View file

@ -1,8 +0,0 @@
test.service:
files:
/etc/file: {}
/etc/file2:
engine: jinja
/etc/dir/incfile:
included: content
version: '1.1'

View file

@ -1,6 +1,5 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
version: '1.1'

View file

@ -1,8 +0,0 @@
test.service:
files:
/etc/file: {}
/etc/file2:
engine: jinja
/etc/dir/incfile:
included: name
version: '1.1'

View file

@ -1,5 +0,0 @@
test.service:
files:
/etc/file:
mode: 755
version: '1.1'

View file

@ -1,5 +0,0 @@
test.service:
files:
/etc/file:
mode: 1755
version: '1.1'

View file

@ -1,6 +1,5 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
version: '1.1'

View file

@ -1,10 +0,0 @@
test.service:
files:
/etc/file:
owner: nobody
group: nobody
/etc/file2:
owner: nobody
group: nobody
engine: jinja
version: '1.1'

View file

@ -1,6 +1,6 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
owner: owner:
@ -9,4 +9,3 @@ general:
group: group:
type: unix_user type: unix_user
default: nobody default: nobody
version: '1.1'

View file

@ -1,18 +0,0 @@
test.service:
files:
/etc/file:
owner:
name: rougail.general.owner
type: variable
group:
name: rougail.general.group
type: variable
/etc/file2:
owner:
name: rougail.general.owner
type: variable
group:
name: rougail.general.group
type: variable
engine: jinja
version: '1.1'

View file

@ -1,6 +1,5 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
version: '1.1'

View file

@ -1,6 +0,0 @@
test.service:
files:
/etc/file: {}
/etc/file2:
engine: jinja
version: '1.1'

View file

@ -1,6 +1,5 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
version: '1.1'

View file

@ -1,6 +0,0 @@
test.service:
files:
/etc/file: {}
/etc/file2:
engine: jinja
version: '1.1'

View file

@ -1,6 +1,5 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
version: '1.1'

View file

@ -1,6 +0,0 @@
test.service:
files:
/etc/file: {}
/etc/file2:
engine: jinja
version: '1.1'

View file

@ -1,6 +1,5 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
version: '1.1'

View file

@ -1,6 +0,0 @@
test.service:
files:
/etc/systemd-makefs@dev-disk-by\x2dpartlabel: {}
/etc/systemd-makefs@dev-disk-by\x2dpartlabel2:
engine: jinja
version: '1.1'

View file

@ -1,10 +1,8 @@
version: 1.1
general: general:
source_var: source_var:
type: string
description: Description description: Description
default: file default: file
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Description description: Description
default: non default: non
version: '1.1'

View file

@ -1,7 +0,0 @@
test.service:
files:
/etc/file:
source:
name: rougail.general.source_var
type: variable
version: '1.1'

View file

@ -1,12 +1,9 @@
version: 1.1
general: general:
float: float:
type: float
description: Description description: Description
default: 0.527 default: 0.527
float_multi: float_multi:
type: float
description: Description description: Description
multi: true
default: default:
- 0.527 - 0.527
version: '1.1'

View file

@ -1,3 +1,4 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string type: string
@ -9,4 +10,3 @@ general:
description: Redefine description description: Redefine description
help: message with " help: message with "
mandatory: false mandatory: false
version: '1.1'

View file

@ -1,9 +1,7 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Redefine description description: Redefine description
hidden: true hidden: true
multi: true
default: default:
- non - non
version: '1.1'

View file

@ -1,10 +1,8 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Redefine description description: Redefine description
hidden: true hidden: true
multi: true
unique: false unique: false
default: default:
- non - non
version: '1.1'

View file

@ -1,10 +1,8 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Redefine description description: Redefine description
hidden: true hidden: true
multi: true
unique: true unique: true
default: default:
- non - non
version: '1.1'

View file

@ -1,13 +1,10 @@
version: 1.1
general: general:
float: float:
type: float
description: Description description: Description
provider: float provider: float
default: 0.527 default: 0.527
float_multi: float_multi:
type: float
description: Description description: Description
multi: true
default: default:
- 0.527 - 0.527
version: '1.1'

View file

@ -1,6 +1,6 @@
version: 1.1
example: example:
description: description:
type: string type: string
provider: example provider: example
mandatory: false mandatory: false
version: '1.1'

View file

@ -1,5 +1,5 @@
version: 1.1
float: float:
type: float type: float
description: Description description: Description
mandatory: false mandatory: false
version: '1.1'

View file

@ -1,14 +1,11 @@
version: 1.1
general: general:
float: float:
type: float
description: Description description: Description
provider: float provider: float
hidden: true hidden: true
default: 0.527 default: 0.527
float_multi: float_multi:
type: float
description: Description description: Description
multi: true
default: default:
- 0.527 - 0.527
version: '1.1'

View file

@ -1,7 +1,6 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Redefine description description: Redefine description
hidden: true hidden: true
default: quote" default: quote"
version: '1.1'

View file

@ -1,7 +1,6 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Redefine description description: Redefine description
hidden: true hidden: true
default: quote'" default: quote'"
version: '1.1'

View file

@ -1,7 +1,6 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Redefine description description: Redefine description
hidden: true hidden: true
default: quote\"\' default: quote\"\'
version: '1.1'

View file

@ -1,9 +1,7 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Redefine description description: Redefine description
hidden: true hidden: true
multi: true
default: default:
- quote" - quote"
version: '1.1'

View file

@ -1,9 +1,7 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Redefine description description: Redefine description
hidden: true hidden: true
multi: true
default: default:
- quote'" - quote'"
version: '1.1'

View file

@ -1,9 +1,7 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Redefine description description: Redefine description
hidden: true hidden: true
multi: true
default: default:
- quote' - quote'
version: '1.1'

View file

@ -1,7 +1,6 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: Redefine description description: Redefine description
hidden: true hidden: true
default: quote' default: quote'
version: '1.1'

View file

@ -1,6 +1,5 @@
version: 1.1
general: general:
general: general:
type: string
description: description description: description
default: non default: non
version: '1.1'

View file

@ -1,4 +1,4 @@
version: 1.1
my_variable: my_variable:
type: boolean type: boolean
mandatory: false mandatory: false
version: '1.1'

View file

@ -1,5 +1,5 @@
version: 1.1
general: general:
description: Other description description: Other description
mode_conteneur_actif: mode_conteneur_actif:
default: non default: non
version: '1.1'

View file

@ -1,3 +1,4 @@
version: 1.1
my_var1: my_var1:
type: string type: string
default: default:
@ -6,6 +7,4 @@ my_var1:
my_var2: my_var2:
default: no default: no
server_deployed: server_deployed:
type: boolean
default: false default: false
version: '1.1'

View file

@ -1,3 +1,4 @@
version: 1.1
server_deployed: server_deployed:
type: boolean type: boolean
general: general:
@ -9,7 +10,5 @@ general:
type: jinja type: jinja
jinja: '{{ rougail.general.mode_conteneur_actif1 | calc_val }}' jinja: '{{ rougail.general.mode_conteneur_actif1 | calc_val }}'
mode_conteneur_actif1: mode_conteneur_actif1:
type: string
description: No change description: No change
default: non default: non
version: '1.1'

View file

@ -1,13 +1,11 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string type: string
description: No change description: No change
mandatory: false
default: default:
type: jinja type: jinja
jinja: '{{ rougail.general.mode_conteneur_actif1 | calc_val }}' jinja: '{{ rougail.general.mode_conteneur_actif1 | calc_val }}'
mode_conteneur_actif1: mode_conteneur_actif1:
type: string
description: No change description: No change
default: non default: non
version: '1.1'

View file

@ -1,15 +1,13 @@
version: 1.1
general: general:
mode: basic mode: basic
mode_conteneur_actif: mode_conteneur_actif:
type: string type: string
description: No change description: No change
mandatory: true
mode: advanced mode: advanced
default: default:
type: jinja type: jinja
jinja: '{{ rougail.general.mode_conteneur_actif1 | calc_val }}' jinja: '{{ rougail.general.mode_conteneur_actif1 | calc_val }}'
mode_conteneur_actif1: mode_conteneur_actif1:
type: string
description: No change description: No change
default: non default: non
version: '1.1'

View file

@ -1,14 +1,12 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: number type: number
description: No change description: No change
hidden: true hidden: true
mandatory: false
default: default:
type: jinja type: jinja
jinja: '{{ 3 | calc_val }}' jinja: '{{ 3 | calc_val }}'
mode_conteneur_actif1: mode_conteneur_actif1:
type: string
description: No change description: No change
default: non default: non
version: '1.1'

View file

@ -1,3 +1,4 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string type: string
@ -5,14 +6,12 @@ general:
hidden: true hidden: true
default: default:
type: jinja type: jinja
jinja: '{{ __mode_conteneur_actif4 | calc_val }}' jinja: '{{ mode_conteneur_actif4 | calc_val }}'
params: params:
__mode_conteneur_actif4: mode_conteneur_actif4:
type: variable type: variable
variable: __mode_conteneur_actif4 variable: mode_conteneur_actif4
optional: true optional: true
mode_conteneur_actif1: mode_conteneur_actif1:
type: string
description: No change description: No change
default: non default: non
version: '1.1'

View file

@ -1,3 +1,4 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string type: string
@ -5,19 +6,17 @@ general:
hidden: true hidden: true
default: default:
type: jinja type: jinja
jinja: '{{ __mode_conteneur_actif4 | calc_val(rougail.general.mode_conteneur_actif1, jinja: '{{ mode_conteneur_actif4 | calc_val(rougail.general.mode_conteneur_actif1,
__mode_conteneur_actif3) }}' mode_conteneur_actif3) }}'
params: params:
__mode_conteneur_actif4: mode_conteneur_actif4:
type: variable type: variable
variable: __mode_conteneur_actif4 variable: mode_conteneur_actif4
optional: true optional: true
__mode_conteneur_actif3: mode_conteneur_actif3:
type: variable type: variable
variable: __mode_conteneur_actif3 variable: mode_conteneur_actif3
optional: true optional: true
mode_conteneur_actif1: mode_conteneur_actif1:
type: string
description: No change description: No change
default: non default: non
version: '1.1'

View file

@ -1,30 +1,26 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
type: string type: string
description: No change description: No change
mandatory: false
default: default:
type: jinja type: jinja
jinja: "{{ \"quote'\" | calc_val }}" jinja: "{{ \"quote'\" | calc_val }}"
mode_conteneur_actif1: mode_conteneur_actif1:
type: string type: string
description: No change description: No change
mandatory: false
default: default:
type: jinja type: jinja
jinja: '{{ "quote\"" | calc_val }}' jinja: '{{ "quote\"" | calc_val }}'
mode_conteneur_actif2: mode_conteneur_actif2:
type: string type: string
description: No change description: No change
mandatory: false
default: default:
type: jinja type: jinja
jinja: "{{ \"quote\\\"'\" | calc_val }}" jinja: "{{ \"quote\\\"'\" | calc_val }}"
mode_conteneur_actif3: mode_conteneur_actif3:
type: string type: string
description: No change description: No change
mandatory: false
default: default:
type: jinja type: jinja
jinja: "{{ \"quote\\\"\\\\'\" | calc_val }}" jinja: "{{ \"quote\\\"\\\\'\" | calc_val }}"
version: '1.1'

View file

@ -1,6 +0,0 @@
{
"rougail.general.mode_conteneur_actif1": {
"owner": "default",
"value": "non"
}
}

View file

@ -1,3 +0,0 @@
{
"rougail.general.mode_conteneur_actif1": "non"
}

View file

@ -1,6 +0,0 @@
{
"rougail.general.mode_conteneur_actif1": {
"owner": "default",
"value": "non"
}
}

View file

@ -1,6 +0,0 @@
general:
mode_conteneur_actif1:
type: string
description: No change
default: non
version: '1.1'

View file

@ -1,29 +0,0 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
def _load_functions(path):
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
loader = _SourceFileLoader('func', path)
spec = _spec_from_loader(loader.name, loader)
func_ = _module_from_spec(spec)
loader.exec_module(func_)
for function in dir(func_):
if function.startswith('_'):
continue
setattr(func, function, getattr(func_, function))
_load_functions('tests/dictionaries_old/../eosfunc/test.py')
try:
from tiramisu4 import *
from tiramisu4.setting import ALLOWED_LEADER_PROPERTIES
except:
from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("normal")
ALLOWED_LEADER_PROPERTIES.add("expert")
option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
optiondescription_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[optiondescription_2], properties=frozenset({"normal"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -1,34 +0,0 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
def _load_functions(path):
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
loader = _SourceFileLoader('func', path)
spec = _spec_from_loader(loader.name, loader)
func_ = _module_from_spec(spec)
loader.exec_module(func_)
for function in dir(func_):
if function.startswith('_'):
continue
setattr(func, function, getattr(func_, function))
_load_functions('tests/dictionaries/../eosfunc/test.py')
try:
from tiramisu4 import *
from tiramisu4.setting import ALLOWED_LEADER_PROPERTIES
except:
from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("normal")
ALLOWED_LEADER_PROPERTIES.add("expert")
option_2 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
optiondescription_1 = OptionDescription(name="general", doc="general", children=[option_2], properties=frozenset({"normal"}))
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_1], properties=frozenset({"normal"}))
optiondescription_5 = OptionDescription(name="1", doc="1", children=[optiondescription_6])
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
optiondescription_3 = OptionDescription(name="general", doc="general", children=[option_4], properties=frozenset({"normal"}))
optiondescription_8 = OptionDescription(name="rougail", doc="Rougail", children=[optiondescription_3], properties=frozenset({"normal"}))
optiondescription_7 = OptionDescription(name="2", doc="2", children=[optiondescription_8])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_5, optiondescription_7])

View file

@ -1,16 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif1" type="string" description="No change">
<value>non</value>
</variable>
</family>
</variables>
<constraints>
<fill name="calc_val">
<param type="variable">mode_conteneur_actif1</param>
<target optional="True">mode_conteneur_actif</target>
</fill>
</constraints>
</rougail>

View file

@ -1,20 +0,0 @@
version: '0.10'
variables:
- family:
- name: general
variables:
- variable:
- name: mode_conteneur_actif1
type: string
description: No change
value:
- text: non
constraints:
- fill:
- name: calc_val
param:
- type: variable
text: mode_conteneur_actif1
target:
- optional: true
text: mode_conteneur_actif

View file

@ -1,5 +1,5 @@
version: 1.1
server_deployed: server_deployed:
type: boolean
default: false default: false
my_var: my_var:
type: string type: string
@ -9,4 +9,3 @@ my_var:
hidden: hidden:
type: jinja type: jinja
jinja: '{% if rougail.server_deployed == true %}hidden{% endif %}' jinja: '{% if rougail.server_deployed == true %}hidden{% endif %}'
version: '1.1'

View file

@ -1,6 +1,6 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
test: test:
- test - test
default: non default: non
version: '1.1'

View file

@ -1,7 +1,7 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
test: test:
- test1 - test1
- test2 - test2
default: non default: non
version: '1.1'

View file

@ -1,3 +1,4 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
test: test:
@ -5,4 +6,3 @@ general:
- test1 - test1
- test2 - test2
default: non default: non
version: '1.1'

View file

@ -1,6 +1,6 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
test: test:
- test - test
default: non default: non
version: '1.1'

View file

@ -1,6 +1,6 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
redefine: true redefine: true
test: test:
- test1 - test1
version: '1.1'

View file

@ -1,4 +1,4 @@
version: 1.1
my_variable: my_variable:
type: string type: string
mandatory: false mandatory: false
version: '1.1'

View file

@ -1,5 +1,5 @@
version: 1.1
my_variable: my_variable:
redefine: true redefine: true
test: test:
- test1 - test1
version: '1.1'

View file

@ -1,6 +1,6 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
test: test:
- test - test
default: non default: non
version: '1.1'

View file

@ -1,6 +1,6 @@
version: 1.1
general: general:
mode_conteneur_actif: mode_conteneur_actif:
redefine: true redefine: true
test: test:
- -
version: '1.1'

View file

@ -1,9 +1,9 @@
version: 1.1
server_deployed: server_deployed:
type: boolean type: boolean
general: general:
description: général description: général
mode_conteneur_actif: mode_conteneur_actif:
type: string
description: No change description: No change
hidden: true hidden: true
default: non default: non
@ -11,7 +11,6 @@ general:
type: string type: string
description: autosave variable description: autosave variable
auto_save: true auto_save: true
mandatory: false
hidden: hidden:
type: jinja type: jinja
jinja: '{% if rougail.general.mode_conteneur_actif == "oui" %}hidden{% endif jinja: '{% if rougail.general.mode_conteneur_actif == "oui" %}hidden{% endif
@ -19,4 +18,3 @@ general:
default: default:
type: jinja type: jinja
jinja: '{{ "oui" | calc_val }}' jinja: '{{ "oui" | calc_val }}'
version: '1.1'

Some files were not shown because too many files have changed in this diff Show more