Compare commits
No commits in common. "f9e2f48788820e1f3f51bf0c13c9a82b83d88bc0" and "e9b4bfb990a503a9811cb0dfdea73a32e0593cef" have entirely different histories.
f9e2f48788
...
e9b4bfb990
|
@ -1,10 +1,5 @@
|
|||
# Rougail
|
||||
|
||||
## Les dictionnaires
|
||||
|
||||
FIXME : explications
|
||||
FIXME : extra
|
||||
|
||||
## Les variables
|
||||
|
||||
- [Les familles](family/README.md)
|
||||
|
@ -12,6 +7,8 @@ FIXME : extra
|
|||
|
||||
## Les services
|
||||
|
||||
- [Les services](service/README.md)
|
||||
- [La gestion d'un service](service/service.md)
|
||||
- [La gestion d'un fichier](service/file.md)
|
||||
- [La gestion d'un fichier de service systemd](service/override.md)
|
||||
- [La gestion d'un port](service/port.md)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Les vérifications des valeurs
|
||||
|
||||
- [Fonction de vérification](function.md)
|
||||
- [Cible de la fonction](../target/variable.md)
|
||||
- [Cible de la fonction](../target/only_var.md)
|
||||
- [Paramètre de la fonction](../param/README.md)
|
||||
- [Réfinition](redefine.md)
|
||||
|
||||
|
|
|
@ -8,6 +8,3 @@ FIXME
|
|||
<!ATTLIST condition fallback (True|False) "False">
|
||||
<!ATTLIST condition force_condition_on_fallback (True|False) "False">
|
||||
<!ATTLIST condition force_inverse_condition_on_fallback (True|False) "False">
|
||||
|
||||
|
||||
on peut mettre plusieurs param (oui ou maybe)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Famille crée dynamiquement
|
||||
|
||||
Pour créer une famille dynamiquement, il faut créer une famille fictive lié à une variable.
|
||||
Pour créer une famille dynamiquement, il faut créer une family fictive lié à une variable.
|
||||
Le nom et la description de la famille et des variables qu'elle contient sera en réalité le prefix du nouveau nom/description. Le suffix viendra de la variable liée.
|
||||
|
||||
Par exemple :
|
||||
|
@ -27,4 +27,3 @@ Dans la famille dynamique "my_dyn_family_val1" on retrouvera une variable "my_dy
|
|||
|
||||
Bien évidement si le contenu de "varname" venait a évolué, de nouvelles familles dynamiques pouvent apparaitre ou des familles dynamiques peuvent disparaître.
|
||||
|
||||
Attention la variable lié à la famille doit être obligatoirement une variable multiple et il n'est pas possible de mettre une famille dans une famille dynamique.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Une famille
|
||||
|
||||
Une famille est un conteneur de variables. Elle peut contenir également des familles.
|
||||
Une famille est un [conteneur de variables](../variables.md).
|
||||
|
||||
Pour décrire une famille il faut mettre au minimum un nom :
|
||||
|
||||
|
@ -16,17 +16,6 @@ Cette famille doit être placé dans une balise [variables](../variables.md) :
|
|||
</variables>
|
||||
```
|
||||
|
||||
Ou dans une autre famille :
|
||||
|
||||
```
|
||||
<variables>
|
||||
<family name="my_family">
|
||||
<family name="second_family"/>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
Attention, il famille vide sera automatiquement supprimée.
|
||||
|
||||
## Description et aide de la famille
|
||||
|
||||
En plus d'un nom, il est possible de mettre une "description" à la famille. C'est une information "utilisateur" qui nous permettra d'avoir des informations complémentaires sur le contenu de cette famille :
|
||||
|
@ -43,9 +32,9 @@ En plus de la description, il est possible de préciser une aide complémentaire
|
|||
|
||||
## Mode de la famille
|
||||
|
||||
Le [mode](../mode.md) par défaut d'une famille correspond au [mode](../mode.md) le plus petite des variables ou des familles qui sont contenu dans cette famille.
|
||||
Le [mode](../mode.md) par défaut d'une famille correspond au [mode](../mode.md) le plus petite des variables dans cette famille.
|
||||
|
||||
Changer le [mode](../mode.md) d'une famille permet de définir le [mode](../mode.md) par défaut des variables ou des familles inclusent dans cette famille.
|
||||
Changer le [mode](../mode.md) d'une famille permet de définir le [mode](../mode.md) par défaut des variables inclusent dans cette famille.
|
||||
|
||||
Pour définir le [mode](../mode.md) :
|
||||
|
||||
|
@ -55,7 +44,7 @@ Pour définir le [mode](../mode.md) :
|
|||
|
||||
## Famille invisible
|
||||
|
||||
Il est possible de cacher une famille, ainsi toutes les variables et des familles inclusent dans cette famille.
|
||||
Il est possible de cacher une famille, ainsi toutes les variables inclusent dans cette famille.
|
||||
|
||||
Cacher une famille signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service.
|
||||
Par contre ces variables sont accessibles lorsqu'on va utiliser ces variables.
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
Une variable calculée est une variable donc sa valeur est le résultat d'une fonction python.
|
||||
|
||||
- [Valeur calculée de la variable](value.md)
|
||||
- [Cible de la fonction](../target/variable.md)
|
||||
- [Cible de la fonction](../target/only_var.md)
|
||||
- [Paramètre de la fonction](../param/README.md)
|
||||
- [Réfinition](redefine.md)
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
# Les services
|
||||
|
||||
|
||||
<!ELEMENT services (service*)>
|
||||
|
||||
<!ELEMENT service ((port* | ip* | file* | override*)*) >
|
||||
<!ATTLIST service name CDATA #REQUIRED>
|
||||
<!ATTLIST service manage (True|False) "True">
|
||||
|
||||
|
|
|
@ -1,143 +1,18 @@
|
|||
# La gestion d'un fichier
|
||||
# Fichier
|
||||
|
||||
## La balise file
|
||||
FIXME
|
||||
|
||||
La gestion des fichiers se fait dans un conteneur de [service](service.md).
|
||||
|
||||
La déclaration du fichier met de générer un fichier à partir d'un template pour le déposer à l'endroit prévu dans la déclaration de cette élément.
|
||||
<!ELEMENT file EMPTY>
|
||||
<!ATTLIST file name CDATA #REQUIRED >
|
||||
<!ATTLIST file file_type (UnicodeOption|variable) "UnicodeOption">
|
||||
<!ATTLIST file variable CDATA #IMPLIED>
|
||||
<!ATTLIST file variable_type (variable) "variable">
|
||||
<!ATTLIST file source CDATA #IMPLIED>
|
||||
<!ATTLIST file mode CDATA "0644">
|
||||
<!ATTLIST file owner CDATA "root">
|
||||
<!ATTLIST file group CDATA "root">
|
||||
<!ATTLIST file filelist CDATA #IMPLIED >
|
||||
<!ATTLIST file redefine (True|False) "False">
|
||||
<!ATTLIST file templating (True|False) "True">
|
||||
|
||||
Il est nécessaire, au minimum, de spécifier le chemin complet du fichier :
|
||||
|
||||
```
|
||||
<services>
|
||||
<service name="squid">
|
||||
<file name="/etc/squid/squid.conf"/>
|
||||
</service>
|
||||
</services>
|
||||
```
|
||||
|
||||
Dans ce cas, le nom du template est déduit du nom du fichier, ici ca sera "squid.conf".
|
||||
|
||||
Si le template a un nom différent (par exemple si plusieurs template se retrouve avec le même nom), il est possible de changer le nom du template avec l'attribut source :
|
||||
|
||||
```
|
||||
<file name="/etc/squid/squid.conf" source="template-squid.conf"/>
|
||||
```
|
||||
|
||||
## Les noms de fichiers dynamique
|
||||
|
||||
Il est possible également de définir le nom du fichier dans une variable :
|
||||
|
||||
```
|
||||
<services>
|
||||
<service name="squid">
|
||||
<file name="my_variable" file_type="variable" source="squid.conf"/>
|
||||
</service>
|
||||
</services>
|
||||
<variables>
|
||||
<variable name="my_variable">
|
||||
<value>/etc/squid/squid.conf</value>
|
||||
</variable>
|
||||
</variables>
|
||||
```
|
||||
|
||||
Dans le cas des fichiers dynamique, la source est obligatoire.
|
||||
|
||||
Et même de définir une variable de type multiple, ce qui génèrera plusiers fichiers :
|
||||
|
||||
```
|
||||
<services>
|
||||
<service name="squid">
|
||||
<file name="my_variable" file_type="variable" source="squid.conf"/>
|
||||
</service>
|
||||
</services>
|
||||
<variables>
|
||||
<variable name="my_variable" multi="True">
|
||||
<value>/etc/squid1/squid.conf</value>
|
||||
<value>/etc/squid2/squid.conf</value>
|
||||
</variable>
|
||||
</variables>
|
||||
```
|
||||
|
||||
Dans ce cas là, le fichier source est identique mais les fichiers de destination seront différent.
|
||||
|
||||
Il peut être important de personnaliser le contenu du fichier suivant le fichier de destination.
|
||||
Dans ce cas il y a deux possibilités :
|
||||
|
||||
- la variable "rougail_filename" contient le nom de fichier de destination
|
||||
- l'utilisateur de l'attribut "variable"
|
||||
|
||||
En effet, il est possible de passer le contenu d'une variable au template :
|
||||
|
||||
```
|
||||
<services>
|
||||
<service name="squid">
|
||||
<file name="my_variable1" file_type="variable" source="squid.conf" variable="my_variable2"/>
|
||||
</service>
|
||||
</services>
|
||||
<variables>
|
||||
<variable name="my_variable1" multi="True">
|
||||
<value>/etc/squid1/squid.conf</value>
|
||||
<value>/etc/squid2/squid.conf</value>
|
||||
</variable>
|
||||
<variable name="my_variable2" multi="True">
|
||||
<value>squid1</value>
|
||||
<value>squid2</value>
|
||||
</variable>
|
||||
</variables>
|
||||
```
|
||||
|
||||
Dans ce cas, lors de la génération du fichier /etc/squid1/squid.conf on retrouvera la variable "rougail_variable" avec la valeur "squid1" et le fichier /etc/squid2/squid.conf on retrouvera la variable "rougail_variable" avec la valeur "squid2".
|
||||
|
||||
Attention : les deux variables "my_variable1" et "my_variable2" doivent être multiple et de même longueur.
|
||||
|
||||
## Les droits des fichiers
|
||||
|
||||
Par défaut les droits du fichier généré sont "0644" avec comme utilisateur "root" et groupe "root".
|
||||
|
||||
```
|
||||
<file name="/etc/squid/squid.conf" mode="0640" owner="nobody" group="squid"/>
|
||||
```
|
||||
|
||||
## 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 :
|
||||
|
||||
```
|
||||
<services>
|
||||
<service name="test">
|
||||
<file name="/etc/squid/squid.conf" filelist="squid"/>
|
||||
</service>
|
||||
</services>
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="boolean"/>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<condition name="disabled_if_in" source="condition">
|
||||
<param>False</param>
|
||||
<target type="filelist">squid</target>
|
||||
</condition>
|
||||
</constraints>
|
||||
```
|
||||
|
||||
Dans ce cas, tous les fichiers avec un attribut filelist à "squid" seront désactivé si la variable "condition" est False.
|
||||
|
||||
## Redéfinir une fichier
|
||||
|
||||
Il est possible de redéfinir les éléments d'un fichier dans un dictionnaire différent en utilisant l'attribut redefine :
|
||||
|
||||
```
|
||||
<file name="/etc/squid/squid.conf" source="template-squid.conf" redefine="True"/>
|
||||
```
|
||||
|
||||
## Choix du moteur de templating
|
||||
|
||||
Par défaut, le moteur de templating est le moteur de templating compatible avec "creole".
|
||||
|
||||
Aujourd'hui il est possible de désactiver la templatisation du fichier (il sera alors uniquement copié) :
|
||||
|
||||
```
|
||||
<file name="/etc/squid/squid.conf" templating="none"/>
|
||||
```
|
||||
|
|
|
@ -1,35 +1,7 @@
|
|||
# Override
|
||||
|
||||
## La balise override
|
||||
FIXME
|
||||
|
||||
La balise override permet de redéfinir facilement un service systemd.
|
||||
|
||||
Il suffit d'avoir un template dont le nom est par défaut le nom du service avec l'extension "service" et de déclarer la balise :
|
||||
|
||||
```
|
||||
<services>
|
||||
<service name="squid">
|
||||
<override/>
|
||||
</service>
|
||||
</services>
|
||||
```
|
||||
|
||||
Dans cette exemple, le template associé doit s'appeler squid.service
|
||||
|
||||
Si le fichier service a un nom différent (par exemple si plusieurs template se retrouve avec le même nom), il est possible de changer le nom du template avec l'attribut source :
|
||||
|
||||
```
|
||||
<override source="test.service"/>
|
||||
```
|
||||
|
||||
Dans ce cas le fichier de destination aura le même nom.
|
||||
|
||||
## Choix du moteur de templating
|
||||
|
||||
Par défaut, le moteur de templating est le moteur de templating compatible avec "creole".
|
||||
|
||||
Aujourd'hui il est possible de désactiver la templatisation du fichier (il sera alors uniquement copié) :
|
||||
|
||||
```
|
||||
<override templating="none"/>
|
||||
```
|
||||
<!ELEMENT override EMPTY>
|
||||
<!ATTLIST override source CDATA #IMPLIED >
|
||||
<!ATTLIST override templating (True|False) "True">
|
||||
|
|
|
@ -1,61 +1,7 @@
|
|||
# Port
|
||||
|
||||
## La balise port
|
||||
<!ELEMENT port (#PCDATA)>
|
||||
<!ATTLIST port port_type (PortOption|variable) "PortOption">
|
||||
<!ATTLIST port portlist CDATA #IMPLIED >
|
||||
<!ATTLIST port protocol (tcp|udp) "tcp">
|
||||
|
||||
La balise port permet d'associer un port à service :
|
||||
|
||||
```
|
||||
<services>
|
||||
<service name="squid">
|
||||
<port>3128</port>
|
||||
</service>
|
||||
</services>
|
||||
```
|
||||
|
||||
Il est possible de choisir le protocole TCP ou UDP (TCP par défaut) :
|
||||
|
||||
```
|
||||
<port protocol="udp">123</port>
|
||||
```
|
||||
|
||||
## Les numéros de port dynamique
|
||||
|
||||
Il est possible également de définir le port dans une variable :
|
||||
|
||||
```
|
||||
<services>
|
||||
<service name="squid">
|
||||
<port port_type="variable">my_variable</port>
|
||||
</service>
|
||||
</services>
|
||||
<variables>
|
||||
<variable name="my_variable" type="port">
|
||||
<value>123</value>
|
||||
</variable>
|
||||
</variables>
|
||||
```
|
||||
|
||||
## Désactiver le port
|
||||
|
||||
Il est possible de définir une [condition](../condition/README.md) de type "disabled_if_in" ou "disabled_if_not_in" sur une balise port :
|
||||
|
||||
```
|
||||
<services>
|
||||
<service name="test">
|
||||
<port portlist="squid">3128</port>
|
||||
</service>
|
||||
</services>
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="boolean"/>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<condition name="disabled_if_in" source="condition">
|
||||
<param>False</param>
|
||||
<target type="portlist">squid</target>
|
||||
</condition>
|
||||
</constraints>
|
||||
```
|
||||
|
||||
Dans ce cas, tous les ports avec un attribut portlist à "squid" seront désactivé si la variable "condition" est False.
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
# La gestion d'un service
|
||||
|
||||
Un service est inclut dans un conteneur [services](../services.md).
|
||||
|
||||
Cette balise permet de définir tous les éléments (fichier, port, IP, ...) lié à un service ou à démon.
|
||||
|
||||
Il faut, à la création du service, préciser son nom :
|
||||
|
||||
```
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<services>
|
||||
<service name="squid"/>
|
||||
</services>
|
||||
</rougail>
|
||||
```
|
|
@ -1,14 +0,0 @@
|
|||
# Le conteneur des services
|
||||
|
||||
La balise "services" est le conteneur de l'ensemble des [services](service/service.md).
|
||||
|
||||
Il est placé à la racine du dictionnaire :
|
||||
|
||||
```
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<services/>
|
||||
</rougail>
|
||||
```
|
||||
|
||||
Attention, cette balise ne peut pas être placé dans un dictionnaire "extra".
|
|
@ -2,17 +2,12 @@
|
|||
|
||||
## Un variable
|
||||
|
||||
Une variable est forcement dans [variables](../variables.md) ou dans une [famille](../family/README.md).
|
||||
Une variable est forcement dans une [famille](../family/README.md). Il faut donc déjà avoir créer une [famille](../family/README.md).
|
||||
|
||||
Une variable est déjà un nom. C'est à dire qu'on pourra utiliser plus tard la variable via ce nom.
|
||||
|
||||
```
|
||||
<variables>
|
||||
<variable name="my_variable"/>
|
||||
<family name="my_family">
|
||||
<variable name="my_family_variable"/>
|
||||
</variable>
|
||||
</variables>
|
||||
```
|
||||
|
||||
## Description et aide sur la variable
|
||||
|
@ -78,8 +73,6 @@ Pour définir une variable à valeur multiple :
|
|||
|
||||
Le [mode](../mode.md) par défaut d'une variable correspond au [mode](../mode.md) de la [famille](../family/README.md).
|
||||
|
||||
Si la variable n'est pas dans une famille, la variable aura le mode "normal" par défaut.
|
||||
|
||||
Pour définir le [mode](../mode.md) :
|
||||
|
||||
```
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# Le conteneur des variables
|
||||
|
||||
La balise "variables" est le conteneur de l'ensemble des [familles](family/README.md) et des [variables](variable/README.md).
|
||||
|
||||
Il est placé à la racine du dictionnaire :
|
||||
La balise "variables" est le conteneur de l'ensemble des [familles](family/README.md) dans laquelle on pourra placer des [variables](variable/README.md) :
|
||||
|
||||
```
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
|
|
|
@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
"""
|
||||
from typing import List, Any
|
||||
|
||||
from .variable import CONVERT_OPTION
|
||||
from .target import TargetAnnotator
|
||||
from .param import ParamAnnotator
|
||||
|
||||
|
@ -60,17 +61,6 @@ class CheckAnnotator(TargetAnnotator, ParamAnnotator):
|
|||
self.convert_check()
|
||||
del objectspace.space.constraints.check
|
||||
|
||||
def valid_type_validation(self,
|
||||
obj,
|
||||
) -> None:
|
||||
variable_type = None
|
||||
if obj.name == 'valid_enum':
|
||||
for target in obj.target:
|
||||
if variable_type and target.name.type != variable_type:
|
||||
raise Exception('pfff')
|
||||
variable_type = target.name.type
|
||||
return variable_type
|
||||
|
||||
def check_check(self): # pylint: disable=R0912
|
||||
"""valid and manage <check>
|
||||
"""
|
||||
|
@ -129,7 +119,7 @@ class CheckAnnotator(TargetAnnotator, ParamAnnotator):
|
|||
variable.mandatory = True
|
||||
# build choice
|
||||
variable.values = []
|
||||
variable.ori_type = variable.type
|
||||
variable_type = variable.type
|
||||
variable.type = 'choice'
|
||||
|
||||
has_variable = False
|
||||
|
@ -139,7 +129,7 @@ class CheckAnnotator(TargetAnnotator, ParamAnnotator):
|
|||
msg = _(f'only one "variable" parameter is allowed for valid_enum '
|
||||
f'of variable "{variable.name}"')
|
||||
raise DictConsistencyError(msg, 5, param.xmlfiles)
|
||||
param_type = variable.ori_type
|
||||
param_type = variable_type
|
||||
if param.type == 'variable':
|
||||
has_variable = True
|
||||
if param.optional is True:
|
||||
|
@ -151,9 +141,24 @@ class CheckAnnotator(TargetAnnotator, ParamAnnotator):
|
|||
f'of variable "{variable.name}"')
|
||||
raise DictConsistencyError(msg, 6, param.xmlfiles)
|
||||
param_type = 'calculation'
|
||||
values.append(param.text)
|
||||
value = param.text
|
||||
elif param.type == 'nil':
|
||||
value = None
|
||||
else:
|
||||
if 'type' in vars(param) and variable_type != param.type:
|
||||
msg = _(f'parameter in valid_enum has incompatible type "{param.type}" '
|
||||
f'with type of the variable "{variable.name}" ("{variable_type}")')
|
||||
raise DictConsistencyError(msg, 7, param.xmlfiles)
|
||||
if hasattr(param, 'text'):
|
||||
try:
|
||||
value = CONVERT_OPTION[variable_type].get('func', str)(param.text)
|
||||
except ValueError as err:
|
||||
msg = _(f'unable to change type of a valid_enum entry "{param.text}" '
|
||||
f'is not a valid "{variable_type}" for "{variable.name}"')
|
||||
raise DictConsistencyError(msg, 13, variable.xmlfiles) from err
|
||||
values.append(value)
|
||||
choice = self.objectspace.choice(variable.xmlfiles)
|
||||
choice.name = param.text
|
||||
choice.name = value
|
||||
choice.type = param_type
|
||||
variable.values.append(choice)
|
||||
|
||||
|
@ -161,7 +166,7 @@ class CheckAnnotator(TargetAnnotator, ParamAnnotator):
|
|||
return None
|
||||
|
||||
for target in check.target:
|
||||
self.objectspace.valid_enums[target.name.path] = {'type': variable.ori_type,
|
||||
self.objectspace.valid_enums[target.name.path] = {'type': variable_type,
|
||||
'values': values,
|
||||
'xmlfiles': check.xmlfiles,
|
||||
}
|
||||
|
|
|
@ -33,12 +33,11 @@ from ..config import Config
|
|||
|
||||
from .target import TargetAnnotator
|
||||
from .param import ParamAnnotator
|
||||
from .variable import Walk
|
||||
|
||||
FREEZE_AUTOFREEZE_VARIABLE = 'module_instancie'
|
||||
|
||||
|
||||
class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
|
||||
class ConditionAnnotator(TargetAnnotator, ParamAnnotator):
|
||||
"""Annotate condition
|
||||
"""
|
||||
def __init__(self,
|
||||
|
@ -54,27 +53,28 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
|
|||
self.target_is_uniq = False
|
||||
self.only_variable = False
|
||||
self.convert_target(self.objectspace.space.constraints.condition)
|
||||
self.check_condition_fallback()
|
||||
self.convert_condition_source()
|
||||
self.convert_param(self.objectspace.space.constraints.condition)
|
||||
self.check_source_target()
|
||||
self.check_condition_fallback()
|
||||
self.convert_xxxlist()
|
||||
self.convert_condition_source()
|
||||
self.check_choice_option_condition()
|
||||
self.remove_condition_with_empty_target()
|
||||
self.convert_condition()
|
||||
|
||||
def valid_type_validation(self,
|
||||
obj,
|
||||
) -> None:
|
||||
if obj.source.type == 'choice':
|
||||
return obj.source.ori_type
|
||||
return obj.source.type
|
||||
|
||||
def convert_auto_freeze(self):
|
||||
"""convert auto_freeze
|
||||
only if FREEZE_AUTOFREEZE_VARIABLE == 'oui' this variable is frozen
|
||||
"""
|
||||
for variable in self.get_variables():
|
||||
for variables in self.objectspace.space.variables.values():
|
||||
for family in variables.family.values():
|
||||
if not hasattr(family, 'variable'):
|
||||
continue
|
||||
for variable in family.variable.values():
|
||||
if isinstance(variable, self.objectspace.leadership):
|
||||
for follower in variable.variable:
|
||||
self._convert_auto_freeze(follower)
|
||||
else:
|
||||
self._convert_auto_freeze(variable)
|
||||
|
||||
def _convert_auto_freeze(self,
|
||||
|
@ -108,9 +108,9 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
|
|||
for condition in self.objectspace.space.constraints.condition:
|
||||
for target in condition.target:
|
||||
if target.type == 'variable' and \
|
||||
condition.source.path == target.name.path:
|
||||
condition.source in [target.name.name, target.name.path]:
|
||||
msg = _('target name and source name must be different: '
|
||||
f'{condition.source.path}')
|
||||
f'{condition.source}')
|
||||
raise DictConsistencyError(msg, 11, condition.xmlfiles)
|
||||
|
||||
def check_condition_fallback(self):
|
||||
|
@ -249,12 +249,11 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
|
|||
param3 = self.objectspace.param(target.xmlfiles)
|
||||
param3.name = f'condition_{fill.index}'
|
||||
param3.type = 'variable'
|
||||
param3.text = condition.source.path
|
||||
param3.text = condition.source
|
||||
fill.param.append(param3)
|
||||
param4 = self.objectspace.param(target.xmlfiles)
|
||||
param4.name = f'expected_{fill.index}'
|
||||
param4.text = values
|
||||
param4.type = condition.param[0].type
|
||||
fill.param.append(param4)
|
||||
if condition.name != 'disabled_if_in':
|
||||
param5 = self.objectspace.param(target.xmlfiles)
|
||||
|
@ -322,6 +321,7 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
|
|||
for condition in self.objectspace.space.constraints.condition:
|
||||
actions = self.get_actions_from_condition(condition.name)
|
||||
for param in condition.param:
|
||||
text = getattr(param, 'text', None)
|
||||
for target in condition.target:
|
||||
leader_or_variable, variables = self._get_family_variables_from_target(target)
|
||||
# if option is already disable, do not apply disable_if_in
|
||||
|
@ -331,7 +331,7 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
|
|||
if getattr(leader_or_variable, main_action, False) is True:
|
||||
continue
|
||||
self.build_property(leader_or_variable,
|
||||
param,
|
||||
text,
|
||||
condition,
|
||||
main_action,
|
||||
)
|
||||
|
@ -343,14 +343,14 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
|
|||
# other actions are set to the variable or children of family
|
||||
for variable in variables:
|
||||
self.build_property(variable,
|
||||
param,
|
||||
text,
|
||||
condition,
|
||||
action,
|
||||
)
|
||||
|
||||
def build_property(self,
|
||||
obj,
|
||||
param: 'self.objectspace.param',
|
||||
text: Any,
|
||||
condition: 'self.objectspace.condition',
|
||||
action: str,
|
||||
) -> 'self.objectspace.property_':
|
||||
|
@ -360,7 +360,7 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
|
|||
prop.type = 'calculation'
|
||||
prop.inverse = condition.name.endswith('_if_not_in')
|
||||
prop.source = condition.source
|
||||
prop.expected = param
|
||||
prop.expected = text
|
||||
prop.name = action
|
||||
if not hasattr(obj, 'properties'):
|
||||
obj.properties = []
|
||||
|
|
|
@ -27,7 +27,6 @@ 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 .variable import Walk
|
||||
|
||||
|
||||
#mode order is important
|
||||
|
@ -53,7 +52,7 @@ class Mode: # pylint: disable=R0903
|
|||
modes = {name: Mode(name, idx) for idx, name in enumerate(modes_level)}
|
||||
|
||||
|
||||
class FamilyAnnotator(Walk):
|
||||
class FamilyAnnotator:
|
||||
"""Annotate family
|
||||
"""
|
||||
def __init__(self,
|
||||
|
@ -68,39 +67,26 @@ class FamilyAnnotator(Walk):
|
|||
self.dynamic_families()
|
||||
self.convert_help()
|
||||
|
||||
def _has_variable(self,
|
||||
family: 'self.objectspace.family',
|
||||
) -> bool:
|
||||
if hasattr(family, 'variable'):
|
||||
for variable in family.variable.values():
|
||||
if isinstance(variable, self.objectspace.family):
|
||||
if self._has_variable(variable):
|
||||
return True
|
||||
else:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return False
|
||||
|
||||
def remove_empty_families(self) -> None:
|
||||
"""Remove all families without any variable
|
||||
"""
|
||||
for families in self.objectspace.space.variables.values():
|
||||
removed_families = []
|
||||
for family_name, family in families.variable.items():
|
||||
if isinstance(family, self.objectspace.family) and not self._has_variable(family):
|
||||
for family_name, family in families.family.items():
|
||||
if not hasattr(family, 'variable') or len(family.variable) == 0:
|
||||
removed_families.append(family_name)
|
||||
for family_name in removed_families:
|
||||
del families.variable[family_name]
|
||||
del families.family[family_name]
|
||||
|
||||
def family_names(self) -> None:
|
||||
"""Set doc, path, ... to family
|
||||
"""
|
||||
for family in self.get_families():
|
||||
for families in self.objectspace.space.variables.values():
|
||||
families.doc = families.name
|
||||
families.path = families.name
|
||||
for family in families.family.values():
|
||||
if not hasattr(family, 'description'):
|
||||
family.description = family.name
|
||||
if not hasattr(family, 'path'):
|
||||
family.path = family.name
|
||||
family.doc = family.description
|
||||
del family.description
|
||||
family.name = normalize_family(family.name)
|
||||
|
@ -108,46 +94,23 @@ class FamilyAnnotator(Walk):
|
|||
def change_modes(self):
|
||||
"""change the mode of variables
|
||||
"""
|
||||
for families in self.objectspace.space.variables.values():
|
||||
for family in families.family.values():
|
||||
family_mode = family.mode
|
||||
# default is high level
|
||||
new_family_mode = modes_level[-1]
|
||||
for family in self.objectspace.space.variables.values():
|
||||
self.change_family_mode(family,
|
||||
new_family_mode,
|
||||
first=True,
|
||||
)
|
||||
|
||||
def change_family_mode(self,
|
||||
family: 'self.objectspace.family',
|
||||
new_family_mode: str,
|
||||
first: bool=False,
|
||||
) -> str:
|
||||
if hasattr(family, 'mode'):
|
||||
family_mode = family.mode
|
||||
else:
|
||||
family_mode = new_family_mode
|
||||
if hasattr(family, 'variable'):
|
||||
# change variable mode, but not if variables are not in a family
|
||||
for variable in family.variable.values():
|
||||
if isinstance(variable, self.objectspace.family):
|
||||
new_family_mode = self.change_family_mode(variable,
|
||||
new_family_mode,
|
||||
)
|
||||
continue
|
||||
if first:
|
||||
continue
|
||||
if isinstance(variable, self.objectspace.leadership):
|
||||
func = self._change_variable_mode_leader
|
||||
else:
|
||||
if not isinstance(variable, self.objectspace.leadership):
|
||||
func = self._change_variabe_mode
|
||||
else:
|
||||
func = self._change_variable_mode_leader
|
||||
func(variable,
|
||||
family_mode,
|
||||
)
|
||||
if modes[new_family_mode] > modes[variable.mode]:
|
||||
new_family_mode = variable.mode
|
||||
if not first:
|
||||
# set the lower variable mode to family
|
||||
family.mode = new_family_mode
|
||||
return new_family_mode
|
||||
|
||||
def _change_variabe_mode(self,
|
||||
variable,
|
||||
|
@ -197,7 +160,8 @@ class FamilyAnnotator(Walk):
|
|||
def dynamic_families(self):
|
||||
"""link dynamic families to object
|
||||
"""
|
||||
for family in self.get_families():
|
||||
for families in self.objectspace.space.variables.values():
|
||||
for family in families.family.values():
|
||||
if 'dynamic' not in vars(family):
|
||||
continue
|
||||
family.suffixes = self.objectspace.paths.get_variable(family.dynamic)
|
||||
|
@ -206,15 +170,12 @@ class FamilyAnnotator(Walk):
|
|||
msg = _(f'dynamic family "{family.name}" must be linked '
|
||||
f'to multi variable')
|
||||
raise DictConsistencyError(msg, 16, family.xmlfiles)
|
||||
for variable in family.variable.values():
|
||||
if isinstance(variable, self.objectspace.family):
|
||||
msg = _(f'dynamic family "{family.name}" cannot contains another family')
|
||||
raise DictConsistencyError(msg, 2, family.xmlfiles)
|
||||
|
||||
def convert_help(self):
|
||||
"""Convert variable help
|
||||
"""
|
||||
for family in self.get_families():
|
||||
for families in self.objectspace.space.variables.values():
|
||||
for family in families.family.values():
|
||||
if not hasattr(family, 'help'):
|
||||
continue
|
||||
if not hasattr(family, 'information'):
|
||||
|
|
|
@ -24,18 +24,11 @@ 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 CONVERT_OPTION
|
||||
|
||||
from ..i18n import _
|
||||
from ..error import DictConsistencyError
|
||||
|
||||
|
||||
class ParamAnnotator:
|
||||
def valid_type_validation(self,
|
||||
obj,
|
||||
) -> None:
|
||||
return None
|
||||
|
||||
def convert_param(self, objects) -> None:
|
||||
""" valid and convert param
|
||||
"""
|
||||
|
@ -43,7 +36,6 @@ class ParamAnnotator:
|
|||
if not hasattr(obj, 'param'):
|
||||
continue
|
||||
param_to_delete = []
|
||||
variable_type = self.valid_type_validation(obj)
|
||||
for param_idx, param in enumerate(obj.param):
|
||||
if param.type == 'suffix':
|
||||
if hasattr(param, 'text'):
|
||||
|
@ -58,18 +50,15 @@ class ParamAnnotator:
|
|||
if not param.type == 'nil':
|
||||
msg = _(f'"{param.type}" parameter must have a value')
|
||||
raise DictConsistencyError(msg, 27, obj.xmlfiles)
|
||||
param.text = None
|
||||
elif param.type == 'nil':
|
||||
msg = _(f'"{param.type}" parameter must not have a value')
|
||||
raise DictConsistencyError(msg, 40, obj.xmlfiles)
|
||||
elif param.type == 'variable':
|
||||
if param.type == 'variable':
|
||||
try:
|
||||
path, suffix = self.objectspace.paths.get_variable_path(param.text,
|
||||
obj.namespace,
|
||||
)
|
||||
param.text = self.objectspace.paths.get_variable(path)
|
||||
if variable_type and param.text.type != variable_type:
|
||||
raise Exception('pfff', variable_type, param.text.type)
|
||||
if suffix:
|
||||
param.suffix = suffix
|
||||
family_path = self.objectspace.paths.get_variable_family_path(path)
|
||||
|
@ -80,18 +69,6 @@ class ParamAnnotator:
|
|||
if err.errno != 42 or not param.optional:
|
||||
raise err
|
||||
param_to_delete.append(param_idx)
|
||||
elif variable_type:
|
||||
if 'type' in vars(param) and variable_type != param.type:
|
||||
msg = _(f'parameter has incompatible type "{param.type}" '
|
||||
f'with type "{variable_type}")')
|
||||
raise DictConsistencyError(msg, 7, param.xmlfiles)
|
||||
try:
|
||||
param.text = CONVERT_OPTION[variable_type].get('func', str)(param.text)
|
||||
except ValueError as err:
|
||||
msg = _(f'unable to change type of "{param.text}" '
|
||||
f'is not a valid "{variable_type}"')
|
||||
raise DictConsistencyError(msg, 13, param.xmlfiles) from err
|
||||
param.type = variable_type
|
||||
param_to_delete.sort(reverse=True)
|
||||
for param_idx in param_to_delete:
|
||||
obj.param.pop(param_idx)
|
||||
|
|
|
@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
"""
|
||||
from ..i18n import _
|
||||
from ..error import DictConsistencyError
|
||||
from .variable import Walk
|
||||
|
||||
|
||||
PROPERTIES = ('hidden', 'frozen', 'auto_freeze', 'auto_save', 'force_default_on_freeze',
|
||||
|
@ -36,7 +35,7 @@ CONVERT_PROPERTIES = {'auto_save': ['force_store_value'],
|
|||
}
|
||||
|
||||
|
||||
class PropertyAnnotator(Walk):
|
||||
class PropertyAnnotator:
|
||||
"""Annotate properties
|
||||
"""
|
||||
def __init__(self, objectspace):
|
||||
|
@ -44,8 +43,7 @@ class PropertyAnnotator(Walk):
|
|||
if hasattr(self.objectspace.space, 'services'):
|
||||
self.convert_services()
|
||||
if hasattr(self.objectspace.space, 'variables'):
|
||||
self.convert_family()
|
||||
self.convert_variable()
|
||||
self.convert_variables()
|
||||
|
||||
def convert_property(self,
|
||||
variable,
|
||||
|
@ -94,15 +92,15 @@ class PropertyAnnotator(Walk):
|
|||
for variable in family.variable:
|
||||
self.convert_property(variable)
|
||||
|
||||
def convert_family(self) -> None:
|
||||
def convert_variables(self) -> None:
|
||||
"""convert variables
|
||||
"""
|
||||
for family in self.get_families():
|
||||
for variables in self.objectspace.space.variables.values():
|
||||
for family in variables.family.values():
|
||||
self.convert_property(family)
|
||||
|
||||
def convert_variable(self) -> None:
|
||||
for variable in self.get_variables(with_leadership=True):
|
||||
if isinstance(variable, self.objectspace.leadership):
|
||||
for variable in family.variable.values():
|
||||
self.convert_property(variable)
|
||||
if not isinstance(variable, self.objectspace.leadership):
|
||||
continue
|
||||
for follower in variable.variable:
|
||||
self.convert_property(follower)
|
||||
self.convert_property(variable)
|
||||
|
|
|
@ -35,7 +35,7 @@ from ..error import DictConsistencyError
|
|||
ERASED_ATTRIBUTES = ('redefine', 'exists', 'fallback', 'optional', 'remove_check', 'namespace',
|
||||
'remove_condition', 'path', 'instance_mode', 'index',
|
||||
'level', 'remove_fill', 'xmlfiles', 'type', 'reflector_name',
|
||||
'reflector_object',)
|
||||
'reflector_object', 'manage')
|
||||
|
||||
|
||||
KEY_TYPE = {'variable': 'symlink',
|
||||
|
@ -76,6 +76,8 @@ class ServiceAnnotator:
|
|||
self.objectspace.space.services.path = 'services'
|
||||
for service_name, service in self.objectspace.space.services.service.items():
|
||||
service.information = self.objectspace.information(service.xmlfiles)
|
||||
service.information.manage = service.manage
|
||||
service.manage = None
|
||||
for elttype, values in dict(vars(service)).items():
|
||||
if not isinstance(values, (dict, list)) or elttype in ERASED_ATTRIBUTES:
|
||||
continue
|
||||
|
|
|
@ -24,9 +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 .variable import Walk
|
||||
|
||||
class ValueAnnotator(Walk): # pylint: disable=R0903
|
||||
class ValueAnnotator: # pylint: disable=R0903
|
||||
"""Annotate value
|
||||
"""
|
||||
def __init__(self,
|
||||
|
@ -40,7 +39,11 @@ class ValueAnnotator(Walk): # pylint: disable=R0903
|
|||
def convert_value(self) -> None:
|
||||
"""convert value
|
||||
"""
|
||||
for variable in self.get_variables(with_leadership=True):
|
||||
for families in self.objectspace.space.variables.values():
|
||||
for family in families.family.values():
|
||||
if not hasattr(family, 'variable'):
|
||||
continue
|
||||
for variable in family.variable.values():
|
||||
if isinstance(variable, self.objectspace.leadership):
|
||||
variable_type = 'leader'
|
||||
for follower in variable.variable:
|
||||
|
|
|
@ -25,8 +25,6 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
from ..objspace import convert_boolean
|
||||
|
||||
|
||||
CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
|
||||
'float': dict(opttype="FloatOption", func=float),
|
||||
|
@ -34,7 +32,7 @@ CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
|
|||
'string': dict(opttype="StrOption"),
|
||||
'password': dict(opttype="PasswordOption"),
|
||||
'mail': dict(opttype="EmailOption"),
|
||||
'boolean': dict(opttype="BoolOption", func=convert_boolean),
|
||||
'boolean': dict(opttype="BoolOption"),
|
||||
'symlink': dict(opttype="SymLinkOption"),
|
||||
'filename': dict(opttype="FilenameOption"),
|
||||
'date': dict(opttype="DateOption"),
|
||||
|
@ -65,52 +63,7 @@ FORCE_CHOICE = {'schedule': ['none', 'daily', 'weekly', 'monthly'],
|
|||
}
|
||||
|
||||
|
||||
class Walk:
|
||||
"""Walk to objectspace to find variable or family
|
||||
"""
|
||||
def get_variables(self,
|
||||
with_leadership: bool=False,
|
||||
):
|
||||
"""Iter all variables from the objectspace
|
||||
"""
|
||||
for family in self.objectspace.space.variables.values():
|
||||
yield from self._get_variables(family, with_leadership)
|
||||
|
||||
def _get_variables(self,
|
||||
family: 'self.objectspace.family',
|
||||
with_leadership: bool
|
||||
):
|
||||
if hasattr(family, 'variable'):
|
||||
for variable in family.variable.values():
|
||||
if isinstance(variable, self.objectspace.family):
|
||||
yield from self._get_variables(variable, with_leadership)
|
||||
continue
|
||||
if not with_leadership and isinstance(variable, self.objectspace.leadership):
|
||||
for follower in variable.variable:
|
||||
yield follower
|
||||
continue
|
||||
yield variable
|
||||
# if hasattr(family, 'family'):
|
||||
# for fam in family.family.values():
|
||||
# yield from self._get_variables(fam, with_leadership)
|
||||
|
||||
def get_families(self):
|
||||
"""Iter all families from the objectspace
|
||||
"""
|
||||
for family in self.objectspace.space.variables.values():
|
||||
yield from self._get_families(family)
|
||||
|
||||
def _get_families(self,
|
||||
family: 'self.objectspace.family',
|
||||
):
|
||||
yield family
|
||||
if hasattr(family, 'variable'):
|
||||
for fam in family.variable.values():
|
||||
if isinstance(fam, self.objectspace.family):
|
||||
yield from self._get_families(fam)
|
||||
|
||||
|
||||
class VariableAnnotator(Walk): # pylint: disable=R0903
|
||||
class VariableAnnotator: # pylint: disable=R0903
|
||||
"""Annotate variable
|
||||
"""
|
||||
def __init__(self,
|
||||
|
@ -126,21 +79,28 @@ class VariableAnnotator(Walk): # pylint: disable=R0903
|
|||
def convert_variable(self):
|
||||
"""convert variable
|
||||
"""
|
||||
for variable in self.get_variables(with_leadership=True):
|
||||
for families in self.objectspace.space.variables.values():
|
||||
for family in families.family.values():
|
||||
if not hasattr(family, 'variable'):
|
||||
continue
|
||||
for variable in family.variable.values():
|
||||
if isinstance(variable, self.objectspace.leadership):
|
||||
# first variable is a leader, others are follower
|
||||
variable_type = 'leader'
|
||||
for follower in variable.variable:
|
||||
self._convert_variable(follower,
|
||||
self._convert_variable(families.name,
|
||||
follower,
|
||||
variable_type,
|
||||
)
|
||||
variable_type = 'follower'
|
||||
else:
|
||||
self._convert_variable(variable,
|
||||
self._convert_variable(families.name,
|
||||
variable,
|
||||
'variable',
|
||||
)
|
||||
|
||||
def _convert_variable(self,
|
||||
namespace: str,
|
||||
variable,
|
||||
variable_type: str,
|
||||
) -> None:
|
||||
|
@ -167,9 +127,12 @@ class VariableAnnotator(Walk): # pylint: disable=R0903
|
|||
variable.multi = 'submulti'
|
||||
else:
|
||||
variable.multi = True
|
||||
self._convert_valid_enum(variable)
|
||||
self._convert_valid_enum(namespace,
|
||||
variable,
|
||||
)
|
||||
|
||||
def _convert_valid_enum(self,
|
||||
namespace,
|
||||
variable,
|
||||
):
|
||||
"""some types are, in fact, choices
|
||||
|
@ -179,7 +142,7 @@ class VariableAnnotator(Walk): # pylint: disable=R0903
|
|||
if not hasattr(self.objectspace.space, 'constraints'):
|
||||
xmlfiles = variable.xmlfiles
|
||||
self.objectspace.space.constraints = self.objectspace.constraints(xmlfiles)
|
||||
self.objectspace.space.constraints.namespace = variable.namespace
|
||||
self.objectspace.space.constraints.namespace = namespace
|
||||
if not hasattr(self.objectspace.space.constraints, 'check'):
|
||||
self.objectspace.space.constraints.check = []
|
||||
check = self.objectspace.check(variable.xmlfiles)
|
||||
|
@ -187,7 +150,7 @@ class VariableAnnotator(Walk): # pylint: disable=R0903
|
|||
target = self.objectspace.target(variable.xmlfiles)
|
||||
target.name = variable.path
|
||||
check.target = [target]
|
||||
check.namespace = variable.namespace
|
||||
check.namespace = namespace
|
||||
check.param = []
|
||||
for value in FORCE_CHOICE[variable.type]:
|
||||
param = self.objectspace.param(variable.xmlfiles)
|
||||
|
@ -199,7 +162,15 @@ class VariableAnnotator(Walk): # pylint: disable=R0903
|
|||
def convert_test(self):
|
||||
"""Convert variable tests value
|
||||
"""
|
||||
for variable in self.get_variables():
|
||||
for families in self.objectspace.space.variables.values():
|
||||
for family in families.family.values():
|
||||
if not hasattr(family, 'variable'):
|
||||
continue
|
||||
for variable in family.variable.values():
|
||||
if isinstance(variable, self.objectspace.leadership):
|
||||
for follower in variable.variable:
|
||||
self._convert_test(follower)
|
||||
else:
|
||||
self._convert_test(variable)
|
||||
|
||||
def _convert_test(self,
|
||||
|
@ -223,7 +194,15 @@ class VariableAnnotator(Walk): # pylint: disable=R0903
|
|||
def convert_help(self):
|
||||
"""Convert variable help
|
||||
"""
|
||||
for variable in self.get_variables():
|
||||
for families in self.objectspace.space.variables.values():
|
||||
for family in families.family.values():
|
||||
if not hasattr(family, 'variable'):
|
||||
continue
|
||||
for variable in family.variable.values():
|
||||
if isinstance(variable, self.objectspace.leadership):
|
||||
for follower in variable.variable:
|
||||
self._convert_help(follower)
|
||||
else:
|
||||
self._convert_help(variable)
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
<!ELEMENT service ((port* | ip* | file* | override*)*) >
|
||||
<!ATTLIST service name CDATA #REQUIRED>
|
||||
<!ATTLIST service manage (True|False) "True">
|
||||
|
||||
<!ELEMENT port (#PCDATA)>
|
||||
<!ATTLIST port port_type (PortOption|variable) "PortOption">
|
||||
|
@ -72,15 +73,15 @@
|
|||
<!ATTLIST file group CDATA "root">
|
||||
<!ATTLIST file filelist CDATA #IMPLIED >
|
||||
<!ATTLIST file redefine (True|False) "False">
|
||||
<!ATTLIST file templating (creole|none) "creole">
|
||||
<!ATTLIST file templating (True|False) "True">
|
||||
|
||||
<!ELEMENT override EMPTY>
|
||||
<!ATTLIST override source CDATA #IMPLIED >
|
||||
<!ATTLIST override templating (creole|none) "creole">
|
||||
<!ATTLIST override templating (True|False) "True">
|
||||
|
||||
<!ELEMENT variables ((variable*|family*)*)>
|
||||
<!ELEMENT variables (family*)>
|
||||
|
||||
<!ELEMENT family ((variable*|family*)*)>
|
||||
<!ELEMENT family (variable*)>
|
||||
<!ATTLIST family name CDATA #REQUIRED>
|
||||
<!ATTLIST family description CDATA #IMPLIED>
|
||||
<!ATTLIST family help CDATA #IMPLIED>
|
||||
|
@ -126,7 +127,7 @@
|
|||
<!ATTLIST condition force_inverse_condition_on_fallback (True|False) "False">
|
||||
|
||||
<!ELEMENT param (#PCDATA)>
|
||||
<!ATTLIST param type (string|number|nil|boolean|variable|information|suffix) "string">
|
||||
<!ATTLIST param type (string|number|nil|variable|information|suffix) "string">
|
||||
<!ATTLIST param name CDATA #IMPLIED>
|
||||
<!ATTLIST param propertyerror (True|False) "True">
|
||||
<!ATTLIST param optional (True|False) "False">
|
||||
|
|
|
@ -43,9 +43,7 @@ UNREDEFINABLE = ('multi', 'type')
|
|||
# RougailObjSpace's elements that did not created automaticly
|
||||
FORCE_ELEMENTS = ('choice', 'property_', 'leadership', 'information')
|
||||
# XML text are convert has name
|
||||
FORCED_TEXT_ELTS_AS_NAME = ('choice', 'property', 'value',)
|
||||
|
||||
FORCE_TAG = {'family': 'variable'}
|
||||
FORCED_TEXT_ELTS_AS_NAME = ('choice', 'property', 'value', 'target')
|
||||
|
||||
|
||||
# _____________________________________________________________________________
|
||||
|
@ -85,16 +83,6 @@ class ObjSpace: # pylint: disable=R0903
|
|||
"""
|
||||
|
||||
|
||||
def convert_boolean(value: str) -> bool:
|
||||
"""Boolean coercion. The Rougail XML may contain srings like `True` or `False`
|
||||
"""
|
||||
if isinstance(value, bool):
|
||||
return value
|
||||
if value == 'True':
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
class RougailObjSpace:
|
||||
"""Rougail ObjectSpace is an object's reflexion of the XML elements
|
||||
"""
|
||||
|
@ -137,7 +125,7 @@ class RougailObjSpace:
|
|||
# set default value for this attribute
|
||||
default_value = dtd_attr.default_value
|
||||
if dtd_attr.name in self.booleans_attributs:
|
||||
default_value = convert_boolean(default_value)
|
||||
default_value = self.convert_boolean(default_value)
|
||||
attrs[dtd_attr.name] = default_value
|
||||
if dtd_attr.name == 'redefine':
|
||||
# has a redefine attribute, so it's a Redefinable object
|
||||
|
@ -248,8 +236,7 @@ class RougailObjSpace:
|
|||
"""
|
||||
retrieves or creates Rougail Object Subspace objects
|
||||
"""
|
||||
tag = FORCE_TAG.get(child.tag, child.tag)
|
||||
obj = getattr(self, tag)
|
||||
obj = getattr(self, child.tag)
|
||||
name = self._get_name(child, namespace)
|
||||
if Redefinable in obj.__mro__:
|
||||
return self.create_or_update_redefinable_object(xmlfile,
|
||||
|
@ -302,7 +289,7 @@ class RougailObjSpace:
|
|||
# if redefine is set to object, default value is False
|
||||
# otherwise it's always a redefinable object
|
||||
default_redefine = child.tag in FORCE_REDEFINABLES
|
||||
redefine = convert_boolean(subspace.get('redefine', default_redefine))
|
||||
redefine = self.convert_boolean(subspace.get('redefine', default_redefine))
|
||||
if redefine is True:
|
||||
if isinstance(existed_var, self.variable): # pylint: disable=E1101
|
||||
if namespace == Config['variable_namespace']:
|
||||
|
@ -311,25 +298,24 @@ class RougailObjSpace:
|
|||
redefine_variables.append(space.path + '.' + name)
|
||||
existed_var.xmlfiles.append(xmlfile)
|
||||
return existed_var
|
||||
exists = convert_boolean(subspace.get('exists', True))
|
||||
exists = self.convert_boolean(subspace.get('exists', True))
|
||||
if exists is False:
|
||||
raise SpaceObjShallNotBeUpdated()
|
||||
msg = _(f'"{child.tag}" named "{name}" cannot be re-created in "{xmlfile}", '
|
||||
f'already defined')
|
||||
raise DictConsistencyError(msg, 45, existed_var.xmlfiles)
|
||||
# object deos not exists
|
||||
exists = convert_boolean(subspace.get('exists', False))
|
||||
exists = self.convert_boolean(subspace.get('exists', False))
|
||||
if exists is True:
|
||||
# manage object only if already exists, so cancel
|
||||
raise SpaceObjShallNotBeUpdated()
|
||||
redefine = convert_boolean(subspace.get('redefine', False))
|
||||
redefine = self.convert_boolean(subspace.get('redefine', False))
|
||||
if redefine is True:
|
||||
# cannot redefine an inexistant object
|
||||
msg = _(f'Redefined object: "{name}" does not exist yet')
|
||||
raise DictConsistencyError(msg, 46, xmlfile)
|
||||
tag = FORCE_TAG.get(child.tag, child.tag)
|
||||
if tag not in vars(space):
|
||||
setattr(space, tag, {})
|
||||
if child.tag not in vars(space):
|
||||
setattr(space, child.tag, {})
|
||||
return getattr(self, child.tag)(xmlfile, name)
|
||||
|
||||
def get_existed_obj(self,
|
||||
|
@ -342,7 +328,7 @@ class RougailObjSpace:
|
|||
"""
|
||||
if child.tag in ['variable', 'family']:
|
||||
name = normalize_family(name)
|
||||
if child.tag == 'variable': # pylint: disable=E1101
|
||||
if isinstance(space, self.family): # pylint: disable=E1101
|
||||
if namespace != Config['variable_namespace']:
|
||||
name = space.path + '.' + name
|
||||
if not self.paths.path_is_defined(name):
|
||||
|
@ -354,12 +340,21 @@ class RougailObjSpace:
|
|||
raise DictConsistencyError(msg, 47, space.xmlfiles)
|
||||
return self.paths.get_variable(name)
|
||||
# it's not a family
|
||||
tag = FORCE_TAG.get(child.tag, child.tag)
|
||||
children = getattr(space, tag, {})
|
||||
children = getattr(space, child.tag, {})
|
||||
if name in children:
|
||||
return children[name]
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def convert_boolean(value: str) -> bool:
|
||||
"""Boolean coercion. The Rougail XML may contain srings like `True` or `False`
|
||||
"""
|
||||
if isinstance(value, bool):
|
||||
return value
|
||||
if value == 'True':
|
||||
return True
|
||||
return False
|
||||
|
||||
def set_text(self,
|
||||
child,
|
||||
variableobj,
|
||||
|
@ -379,7 +374,7 @@ class RougailObjSpace:
|
|||
):
|
||||
""" set attributes to an object
|
||||
"""
|
||||
redefine = convert_boolean(child.attrib.get('redefine', False))
|
||||
redefine = self.convert_boolean(child.attrib.get('redefine', False))
|
||||
if redefine and child.tag == 'variable':
|
||||
# delete old values
|
||||
has_value = hasattr(variableobj, 'value')
|
||||
|
@ -391,7 +386,7 @@ class RougailObjSpace:
|
|||
f' in "{xmlfile}", already defined')
|
||||
raise DictConsistencyError(msg, 48, variableobj.xmlfiles[:-1])
|
||||
if attr in self.booleans_attributs:
|
||||
val = convert_boolean(val)
|
||||
val = self.convert_boolean(val)
|
||||
if attr == 'name' and getattr(variableobj, 'name', None):
|
||||
# do not redefine name
|
||||
continue
|
||||
|
@ -463,10 +458,7 @@ class RougailObjSpace:
|
|||
"""Fill self.paths attributes
|
||||
"""
|
||||
if isinstance(variableobj, self.variable): # pylint: disable=E1101
|
||||
if 'name' in document.attrib:
|
||||
family_name = normalize_family(document.attrib['name'])
|
||||
else:
|
||||
family_name = namespace
|
||||
self.paths.add_variable(namespace,
|
||||
normalize_family(variableobj.name),
|
||||
namespace + '.' + family_name,
|
||||
|
@ -493,10 +485,9 @@ class RougailObjSpace:
|
|||
variableobj.namespace = namespace
|
||||
if isinstance(variableobj, Redefinable):
|
||||
name = variableobj.name
|
||||
tag = FORCE_TAG.get(child.tag, child.tag)
|
||||
if child.tag in ['family', 'variable']:
|
||||
name = normalize_family(name)
|
||||
getattr(space, tag)[name] = variableobj
|
||||
getattr(space, child.tag)[name] = variableobj
|
||||
elif isinstance(variableobj, UnRedefinable):
|
||||
getattr(space, child.tag).append(variableobj)
|
||||
else:
|
||||
|
|
|
@ -332,7 +332,7 @@ class CreoleTemplateEngine:
|
|||
else:
|
||||
var = None
|
||||
source = join(tmp_dir, filevar['source'])
|
||||
if filevar['templating'] == 'creole':
|
||||
if filevar['templating']:
|
||||
self.process(source,
|
||||
filename,
|
||||
destfilename,
|
||||
|
|
|
@ -215,8 +215,15 @@ class Common:
|
|||
"""Populate properties
|
||||
"""
|
||||
option_name = child.source.reflector_object.get()
|
||||
kwargs = (f"'condition': ParamOption({option_name}, todict=True), "
|
||||
f"'expected': {self.populate_param(child.expected)}")
|
||||
kwargs = f"'condition': ParamOption({option_name}, todict=True), "
|
||||
if child.expected is None or isinstance(child.expected, int):
|
||||
kwargs += f"'expected': ParamValue({child.expected})"
|
||||
elif isinstance(child.expected, str):
|
||||
val = self.convert_str(child.expected)
|
||||
kwargs += f"'expected': ParamValue({val})"
|
||||
else:
|
||||
val = child.expected.reflector_object.get()
|
||||
kwargs += f"'expected': ParamOption({val})"
|
||||
if child.inverse:
|
||||
kwargs += ", 'reverse_condition': ParamValue(True)"
|
||||
return (f"Calculation(func.calc_value, Params(ParamValue('{child.name}'), "
|
||||
|
@ -234,40 +241,6 @@ class Common:
|
|||
value = self.convert_str(value)
|
||||
self.text.append(f"{self.option_name}.impl_set_information('{key}', {value})")
|
||||
|
||||
def populate_param(self,
|
||||
param,
|
||||
):
|
||||
"""Populate variable parameters
|
||||
"""
|
||||
if param.type in ['number', 'boolean', 'nil', 'string']:
|
||||
value = param.text
|
||||
if param.type == 'string' and value is not None:
|
||||
value = self.convert_str(value)
|
||||
return f'ParamValue({value})'
|
||||
if param.type == 'variable':
|
||||
return self.build_option_param(param)
|
||||
if param.type == 'information':
|
||||
return f'ParamInformation("{param.text}", None)'
|
||||
if param.type == 'suffix':
|
||||
return 'ParamSuffix()'
|
||||
raise Exception(f'unknown type {param.type}') # pragma: no cover
|
||||
|
||||
@staticmethod
|
||||
def build_option_param(param,
|
||||
) -> str:
|
||||
"""build variable parameters
|
||||
"""
|
||||
option_name = param.text.reflector_object.get()
|
||||
params = [f'{option_name}']
|
||||
if hasattr(param, 'suffix'):
|
||||
param_type = 'ParamDynOption'
|
||||
params.extend([f"'{param.suffix}'", f'{param.family.reflector_name}'])
|
||||
else:
|
||||
param_type = 'ParamOption'
|
||||
if not param.propertyerror:
|
||||
params.append('notraisepropertyerror=True')
|
||||
return "{}({})".format(param_type, ', '.join(params))
|
||||
|
||||
|
||||
class Variable(Common):
|
||||
"""Manage variable
|
||||
|
@ -324,7 +297,7 @@ class Variable(Common):
|
|||
function = child.name
|
||||
if hasattr(child, 'param'):
|
||||
for param in child.param:
|
||||
value = self.populate_param(param)
|
||||
value = self.populate_param(function, param)
|
||||
if not hasattr(param, 'name'):
|
||||
args.append(str(value))
|
||||
else:
|
||||
|
@ -337,6 +310,46 @@ class Variable(Common):
|
|||
ret += f', warnings_only={child.warnings_only}'
|
||||
return ret + ')'
|
||||
|
||||
def populate_param(self,
|
||||
function: str,
|
||||
param,
|
||||
):
|
||||
"""Populate variable parameters
|
||||
"""
|
||||
if param.type == 'string':
|
||||
value = param.text
|
||||
if value is not None:
|
||||
value = self.convert_str(value)
|
||||
return f"ParamValue({value})"
|
||||
if param.type in ['number', 'boolean']:
|
||||
return f'ParamValue({param.text})'
|
||||
if param.type == 'nil':
|
||||
return 'ParamValue(None)'
|
||||
if param.type == 'variable':
|
||||
return self.build_param(param, function)
|
||||
if param.type == 'information':
|
||||
return f'ParamInformation("{param.text}", None)'
|
||||
if param.type == 'suffix':
|
||||
return 'ParamSuffix()'
|
||||
raise Exception(f'unknown type {param.type}') # pragma: no cover
|
||||
|
||||
@staticmethod
|
||||
def build_param(param,
|
||||
function: str, # pylint: disable=W0613
|
||||
) -> str:
|
||||
"""build variable parameters
|
||||
"""
|
||||
option_name = param.text.reflector_object.get()
|
||||
params = [f'{option_name}']
|
||||
if hasattr(param, 'suffix'):
|
||||
param_type = 'ParamDynOption'
|
||||
params.extend([f"'{param.suffix}'", f'{param.family.reflector_name}'])
|
||||
else:
|
||||
param_type = 'ParamOption'
|
||||
if not param.propertyerror:
|
||||
params.append('notraisepropertyerror=True')
|
||||
return "{}({})".format(param_type, ', '.join(params))
|
||||
|
||||
|
||||
class Family(Common):
|
||||
"""Manage family
|
||||
|
|
|
@ -62,11 +62,11 @@ class XMLReflector:
|
|||
try:
|
||||
document = parse(xmlfile)
|
||||
except XMLSyntaxError as err:
|
||||
raise DictConsistencyError(_(f'not a XML file: {err}'), 52, [xmlfile]) from err
|
||||
raise DictConsistencyError(_(f'not an XML file: {err}'), 52, xmlfile) from err
|
||||
if not self.dtd.validate(document):
|
||||
dtd_error = self.dtd.error_log.filter_from_errors()[0]
|
||||
msg = _(f'not a valid XML file: {dtd_error}')
|
||||
raise DictConsistencyError(msg, 43, [xmlfile])
|
||||
raise DictConsistencyError(msg, 43, xmlfile)
|
||||
return document.getroot()
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -13,5 +13,6 @@ except:
|
|||
from tiramisu import *
|
||||
from rougail.tiramisu import ConvertDynOptionDescription
|
||||
option_2 = OptionDescription(name="tata", doc="tata", children=[])
|
||||
option_2.impl_set_information('manage', True)
|
||||
option_1 = OptionDescription(name="services", doc="services", children=[option_2], properties=frozenset({"hidden"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.mode_conteneur_actif": "non", "services.test.files.file.group": "root", "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.templating": "creole", "services.test.files.file.activate": true}
|
||||
{"rougail.general.mode_conteneur_actif": "non", "services.test.files.file.group": "root", "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.templating": true, "services.test.files.file.activate": true}
|
||||
|
|
|
@ -20,10 +20,11 @@ option_9 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_10 = StrOption(name="name", doc="name", default="/etc/file")
|
||||
option_11 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_12 = StrOption(name="source", doc="source", default="file")
|
||||
option_13 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_13 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_14 = 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_6 = OptionDescription(name="files", doc="files", children=[option_7])
|
||||
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
|
||||
option_5.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.mode_conteneur_actif": "non", "services.test.files.file.group": "root", "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.templating": "creole", "services.test.files.file.activate": true}
|
||||
{"rougail.general.mode_conteneur_actif": "non", "services.test.files.file.group": "root", "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.templating": true, "services.test.files.file.activate": true}
|
||||
|
|
|
@ -20,10 +20,11 @@ option_9 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_10 = StrOption(name="name", doc="name", default="/etc/file")
|
||||
option_11 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_12 = StrOption(name="source", doc="source", default="file")
|
||||
option_13 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_13 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_14 = 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_6 = OptionDescription(name="files", doc="files", children=[option_7])
|
||||
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
|
||||
option_5.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.mode_conteneur_actif": "non", "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.group": "root", "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.templating": "creole", "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.activate": true}
|
||||
{"rougail.general.mode_conteneur_actif": "non", "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.group": "root", "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.templating": true, "services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.activate": true}
|
||||
|
|
|
@ -20,10 +20,11 @@ option_9 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_10 = StrOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel")
|
||||
option_11 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_12 = StrOption(name="source", doc="source", default="systemd-makefs@dev-disk-by\\x2dpartlabel")
|
||||
option_13 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_13 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_14 = 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_6 = OptionDescription(name="files", doc="files", children=[option_7])
|
||||
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
|
||||
option_5.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<constraints>
|
||||
<check name="valid_lower">
|
||||
<param name="mini" type="number">0</param>
|
||||
<param name="mini">0</param>
|
||||
<param name="maxi" type="variable">int2</param>
|
||||
<target>int</target>
|
||||
</check>
|
||||
|
|
|
@ -14,7 +14,7 @@ except:
|
|||
from rougail.tiramisu import ConvertDynOptionDescription
|
||||
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"}))
|
||||
option_4 = IntOption(name="int2", doc="No change", default=100, properties=frozenset({"mandatory", "normal"}))
|
||||
option_5 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption()), kwargs={'mini': ParamValue(0), 'maxi': ParamOption(option_4)}), warnings_only=False)], properties=frozenset({"normal"}))
|
||||
option_5 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption()), kwargs={'mini': ParamValue("0"), 'maxi': ParamOption(option_4)}), warnings_only=False)], 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_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": true}
|
||||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file1.group": "root", "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.templating": true, "services.test.files.file1.activate": true}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(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 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "no", "rougail.general.condition2": "no", "rougail.general.test_variable": "no", "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": true}
|
||||
{"rougail.general.condition": "no", "rougail.general.condition2": "no", "rougail.general.test_variable": "no", "services.test.files.file1.group": "root", "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.templating": true, "services.test.files.file1.activate": true}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(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 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["yes", "maybe"]), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "no", "rougail.general.condition2": "no", "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": false}
|
||||
{"rougail.general.condition": "no", "rougail.general.condition2": "no", "services.test.files.file1.group": "root", "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.templating": true, "services.test.files.file1.activate": false}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(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 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "yes", "rougail.general.condition2": "no", "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": true}
|
||||
{"rougail.general.condition": "yes", "rougail.general.condition2": "no", "services.test.files.file1.group": "root", "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.templating": true, "services.test.files.file1.activate": true}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(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 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "yes", "rougail.general.condition2": "yes", "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": false}
|
||||
{"rougail.general.condition": "yes", "rougail.general.condition2": "yes", "services.test.files.file1.group": "root", "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.templating": true, "services.test.files.file1.activate": false}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(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 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "no", "rougail.general.condition2": "yes", "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": false}
|
||||
{"rougail.general.condition": "no", "rougail.general.condition2": "yes", "services.test.files.file1.group": "root", "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.templating": true, "services.test.files.file1.activate": false}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(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 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue(["yes", "maybe"]), 'reverse_condition_0': ParamValue(True), 'condition_operator': ParamValue("OR"), 'condition_1': ParamOption(option_4), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "oui", "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": false}
|
||||
{"rougail.general.condition": "oui", "services.test.files.file1.group": "root", "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.templating": true, "services.test.files.file1.activate": false}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(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 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "no", "rougail.general.disable_variable": "no", "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": true}
|
||||
{"rougail.general.condition": "no", "rougail.general.disable_variable": "no", "services.test.files.file1.group": "root", "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.templating": true, "services.test.files.file1.activate": true}
|
||||
|
|
|
@ -21,10 +21,11 @@ option_10 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_11 = StrOption(name="name", doc="name", default="/tmp/file1")
|
||||
option_12 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_13 = StrOption(name="source", doc="source", default="file1")
|
||||
option_14 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_14 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_15 = 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_7 = OptionDescription(name="files", doc="files", children=[option_8])
|
||||
option_6 = OptionDescription(name="test", doc="test", children=[option_7])
|
||||
option_6.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": true, "services.test.files.file.group": "root", "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.templating": "creole", "services.test.files.file.activate": true}
|
||||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": true, "services.test.files.file.group": "root", "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.templating": true, "services.test.files.file.activate": true}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(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 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<services>
|
||||
<service name="test">
|
||||
<file name="/tmp/file1" filelist="afilllist"/>
|
||||
</service>
|
||||
</services>
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="boolean"/>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
<condition name="disabled_if_in" source="condition">
|
||||
<param type="boolean">True</param>
|
||||
<target type="filelist">afilllist</target>
|
||||
</condition>
|
||||
</constraints>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
|
@ -1 +0,0 @@
|
|||
{"rougail.general.condition": true, "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": false}
|
|
@ -1,29 +0,0 @@
|
|||
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 *
|
||||
from rougail.tiramisu import ConvertDynOptionDescription
|
||||
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="group", doc="group", default="root")
|
||||
option_9 = StrOption(name="mode", doc="mode", default="0644")
|
||||
option_10 = StrOption(name="name", doc="name", default="/tmp/file1")
|
||||
option_11 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_12 = StrOption(name="source", doc="source", default="file1")
|
||||
option_13 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_14 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), '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_6 = OptionDescription(name="files", doc="files", children=[option_7])
|
||||
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
|
||||
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])
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<services>
|
||||
<service name="test">
|
||||
<file name="/tmp/file1" filelist="afilllist"/>
|
||||
</service>
|
||||
</services>
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="condition" type="boolean">
|
||||
<value>False</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
<condition name="disabled_if_in" source="condition">
|
||||
<param>True</param>
|
||||
<target type="filelist">afilllist</target>
|
||||
</condition>
|
||||
</constraints>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
|
@ -1 +0,0 @@
|
|||
{"rougail.general.condition": false, "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": true}
|
|
@ -1,29 +0,0 @@
|
|||
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 *
|
||||
from rougail.tiramisu import ConvertDynOptionDescription
|
||||
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="group", doc="group", default="root")
|
||||
option_9 = StrOption(name="mode", doc="mode", default="0644")
|
||||
option_10 = StrOption(name="name", doc="name", default="/tmp/file1")
|
||||
option_11 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_12 = StrOption(name="source", doc="source", default="file1")
|
||||
option_13 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_14 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), '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_6 = OptionDescription(name="files", doc="files", children=[option_7])
|
||||
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
|
||||
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])
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "oui", "services.test.files.file.group": "root", "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.templating": "creole", "services.test.files.file.activate": false}
|
||||
{"rougail.general.condition": "oui", "services.test.files.file.group": "root", "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.templating": true, "services.test.files.file.activate": false}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(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 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": true, "services.test.files.file2.group": "root", "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.templating": "creole", "services.test.files.file2.activate": true}
|
||||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file1.group": "root", "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.templating": true, "services.test.files.file1.activate": true, "services.test.files.file2.group": "root", "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.templating": true, "services.test.files.file2.activate": true}
|
||||
|
|
|
@ -22,7 +22,7 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(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 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), '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_18 = StrOption(name="group", doc="group", default="root")
|
||||
|
@ -30,10 +30,11 @@ option_19 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_20 = StrOption(name="name", doc="name", default="/tmp/file2")
|
||||
option_21 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_22 = StrOption(name="source", doc="source", default="file2")
|
||||
option_23 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_23 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_24 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue("oui")})))
|
||||
option_17 = OptionDescription(name="file2", doc="file2", children=[option_18, option_19, option_20, option_21, option_22, option_23, option_24])
|
||||
option_8 = OptionDescription(name="files", doc="files", children=[option_9, option_17])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file.group": "root", "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.templating": "creole", "services.test.files.file.activate": false}
|
||||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file.group": "root", "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.templating": true, "services.test.files.file.activate": false}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(name="name", doc="name", default="/tmp/file")
|
||||
option_13 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_14 = StrOption(name="source", doc="source", default="file")
|
||||
option_15 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file.group": "root", "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.templating": "creole", "services.test.files.file.activate": false}
|
||||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file.group": "root", "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.templating": true, "services.test.files.file.activate": false}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(name="name", doc="name", default="/tmp/file")
|
||||
option_13 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_14 = StrOption(name="source", doc="source", default="file")
|
||||
option_15 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file.group": "root", "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.templating": "creole", "services.test.files.file.activate": false}
|
||||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file.group": "root", "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.templating": true, "services.test.files.file.activate": false}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(name="name", doc="name", default="/tmp/file")
|
||||
option_13 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_14 = StrOption(name="source", doc="source", default="file")
|
||||
option_15 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), 'expected_0': ParamValue("unpossible"), 'reverse_condition_0': ParamValue(True), 'condition_1': ParamOption(option_5), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file.group": "root", "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.templating": "creole", "services.test.files.file.activate": false}
|
||||
{"rougail.general.condition": "non", "rougail.general.mode_conteneur_actif": "non", "rougail.general.mode_conteneur_actif2": "non", "services.test.files.file.group": "root", "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.templating": true, "services.test.files.file.activate": false}
|
||||
|
|
|
@ -22,10 +22,11 @@ option_11 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_12 = StrOption(name="name", doc="name", default="/tmp/file")
|
||||
option_13 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_14 = StrOption(name="source", doc="source", default="file")
|
||||
option_15 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_15 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_16 = BoolOption(name="activate", doc="activate", default=Calculation(func.calc_value, Params((ParamValue(False)), kwargs={'default': ParamValue(True), 'condition_0': ParamOption(option_3), '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_8 = OptionDescription(name="files", doc="files", children=[option_9])
|
||||
option_7 = OptionDescription(name="test", doc="test", children=[option_8])
|
||||
option_7.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.condition": "non", "services.test.files.file1.group": "root", "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.templating": "creole", "services.test.files.file1.activate": false}
|
||||
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.condition": "non", "services.test.files.file1.group": "root", "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.templating": true, "services.test.files.file1.activate": false}
|
||||
|
|
|
@ -21,10 +21,11 @@ option_10 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_11 = StrOption(name="name", doc="name", default="/tmp/file1")
|
||||
option_12 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_13 = StrOption(name="source", doc="source", default="file1")
|
||||
option_14 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_14 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_15 = 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_7 = OptionDescription(name="files", doc="files", children=[option_8])
|
||||
option_6 = OptionDescription(name="test", doc="test", children=[option_7])
|
||||
option_6.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<services>
|
||||
<service name="test">
|
||||
<file name="/etc/file" templating="none"/>
|
||||
<file name="/etc/file" templating="False"/>
|
||||
</service>
|
||||
</services>
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.mode_conteneur_actif": "non", "services.test.files.file.group": "root", "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.templating": "none", "services.test.files.file.activate": true}
|
||||
{"rougail.general.mode_conteneur_actif": "non", "services.test.files.file.group": "root", "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.templating": false, "services.test.files.file.activate": true}
|
||||
|
|
|
@ -20,10 +20,11 @@ option_9 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_10 = StrOption(name="name", doc="name", default="/etc/file")
|
||||
option_11 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_12 = StrOption(name="source", doc="source", default="file")
|
||||
option_13 = StrOption(name="templating", doc="templating", default="none")
|
||||
option_13 = BoolOption(name="templating", doc="templating", default=False)
|
||||
option_14 = 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_6 = OptionDescription(name="files", doc="files", children=[option_7])
|
||||
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
|
||||
option_5.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.mode_conteneur_actif": "non", "services.test.overrides.test_service.group": "root", "services.test.overrides.test_service.mode": "0644", "services.test.overrides.test_service.name": "/systemd/system/test.service.d/rougail.conf", "services.test.overrides.test_service.owner": "root", "services.test.overrides.test_service.source": "test.service", "services.test.overrides.test_service.templating": "creole", "services.test.overrides.test_service.activate": true}
|
||||
{"rougail.general.mode_conteneur_actif": "non", "services.test.overrides.test_service.group": "root", "services.test.overrides.test_service.mode": "0644", "services.test.overrides.test_service.name": "/systemd/system/test.service.d/rougail.conf", "services.test.overrides.test_service.owner": "root", "services.test.overrides.test_service.source": "test.service", "services.test.overrides.test_service.templating": true, "services.test.overrides.test_service.activate": true}
|
||||
|
|
|
@ -20,10 +20,11 @@ option_9 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_10 = StrOption(name="name", doc="name", default="/systemd/system/test.service.d/rougail.conf")
|
||||
option_11 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_12 = StrOption(name="source", doc="source", default="test.service")
|
||||
option_13 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_13 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_14 = 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_12, option_13, option_14])
|
||||
option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7])
|
||||
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
|
||||
option_5.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
|
||||
<services>
|
||||
<service name="test">
|
||||
<override templating="none"/>
|
||||
</service>
|
||||
</services>
|
||||
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
|
@ -1 +0,0 @@
|
|||
{"rougail.general.mode_conteneur_actif": "non", "services.test.overrides.test_service.group": "root", "services.test.overrides.test_service.mode": "0644", "services.test.overrides.test_service.name": "/systemd/system/test.service.d/rougail.conf", "services.test.overrides.test_service.owner": "root", "services.test.overrides.test_service.source": "test.service", "services.test.overrides.test_service.templating": "none", "services.test.overrides.test_service.activate": true}
|
|
@ -1 +0,0 @@
|
|||
%%mode_conteneur_actif
|
|
@ -1,29 +0,0 @@
|
|||
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 *
|
||||
from rougail.tiramisu import ConvertDynOptionDescription
|
||||
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="group", doc="group", default="root")
|
||||
option_9 = StrOption(name="mode", doc="mode", default="0644")
|
||||
option_10 = StrOption(name="name", doc="name", default="/systemd/system/test.service.d/rougail.conf")
|
||||
option_11 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_12 = StrOption(name="source", doc="source", default="test.service")
|
||||
option_13 = StrOption(name="templating", doc="templating", default="none")
|
||||
option_14 = 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_12, option_13, option_14])
|
||||
option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7])
|
||||
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
|
||||
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])
|
|
@ -1 +0,0 @@
|
|||
%%mode_conteneur_actif
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
|
||||
<services>
|
||||
<service name="test">
|
||||
<override source="test2.service"/>
|
||||
</service>
|
||||
</services>
|
||||
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
|
@ -1 +0,0 @@
|
|||
{"rougail.general.mode_conteneur_actif": "non", "services.test.overrides.test2_service.group": "root", "services.test.overrides.test2_service.mode": "0644", "services.test.overrides.test2_service.name": "/systemd/system/test.service.d/rougail.conf", "services.test.overrides.test2_service.owner": "root", "services.test.overrides.test2_service.source": "test2.service", "services.test.overrides.test2_service.templating": "creole", "services.test.overrides.test2_service.activate": true}
|
|
@ -1 +0,0 @@
|
|||
non
|
|
@ -1,29 +0,0 @@
|
|||
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 *
|
||||
from rougail.tiramisu import ConvertDynOptionDescription
|
||||
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="group", doc="group", default="root")
|
||||
option_9 = StrOption(name="mode", doc="mode", default="0644")
|
||||
option_10 = StrOption(name="name", doc="name", default="/systemd/system/test.service.d/rougail.conf")
|
||||
option_11 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_12 = StrOption(name="source", doc="source", default="test2.service")
|
||||
option_13 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_14 = 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_12, option_13, option_14])
|
||||
option_6 = OptionDescription(name="overrides", doc="overrides", children=[option_7])
|
||||
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
|
||||
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])
|
|
@ -1 +0,0 @@
|
|||
%%mode_conteneur_actif
|
|
@ -1 +1 @@
|
|||
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.condition": "oui", "rougail.general.leader.leader": [{"rougail.general.leader.leader": "a", "rougail.general.leader.follower2": null}], "services.test.files.mailname.group": "root", "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.templating": "creole", "services.test.files.mailname.activate": true}
|
||||
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.condition": "oui", "rougail.general.leader.leader": [{"rougail.general.leader.leader": "a", "rougail.general.leader.follower2": null}], "services.test.files.mailname.group": "root", "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.templating": true, "services.test.files.mailname.activate": true}
|
||||
|
|
|
@ -25,10 +25,11 @@ option_14 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_15 = StrOption(name="name", doc="name", default="/etc/mailname")
|
||||
option_16 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_17 = StrOption(name="source", doc="source", default="mailname")
|
||||
option_18 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_18 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_19 = 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_11 = OptionDescription(name="files", doc="files", children=[option_12])
|
||||
option_10 = OptionDescription(name="test", doc="test", children=[option_11])
|
||||
option_10.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.condition": "oui", "rougail.general.leader.leader": [{"rougail.general.leader.leader": "a", "rougail.general.leader.follower2": null}, {"rougail.general.leader.leader": "b", "rougail.general.leader.follower1": null, "rougail.general.leader.follower2": null}], "services.test.files.mailname.group": "root", "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.templating": "creole", "services.test.files.mailname.activate": true}
|
||||
{"rougail.general.mode_conteneur_actif": "non", "rougail.general.condition": "oui", "rougail.general.leader.leader": [{"rougail.general.leader.leader": "a", "rougail.general.leader.follower2": null}, {"rougail.general.leader.leader": "b", "rougail.general.leader.follower1": null, "rougail.general.leader.follower2": null}], "services.test.files.mailname.group": "root", "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.templating": true, "services.test.files.mailname.activate": true}
|
||||
|
|
|
@ -25,10 +25,11 @@ option_14 = StrOption(name="mode", doc="mode", default="0644")
|
|||
option_15 = StrOption(name="name", doc="name", default="/etc/mailname")
|
||||
option_16 = StrOption(name="owner", doc="owner", default="root")
|
||||
option_17 = StrOption(name="source", doc="source", default="mailname")
|
||||
option_18 = StrOption(name="templating", doc="templating", default="creole")
|
||||
option_18 = BoolOption(name="templating", doc="templating", default=True)
|
||||
option_19 = 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_11 = OptionDescription(name="files", doc="files", children=[option_12])
|
||||
option_10 = OptionDescription(name="test", doc="test", children=[option_11])
|
||||
option_10.impl_set_information('manage', True)
|
||||
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])
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<variables>
|
||||
<family name="base">
|
||||
<family name="subfamily">
|
||||
<variable name="variable"/>
|
||||
</family>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
|
@ -1 +0,0 @@
|
|||
{"rougail.base.subfamily.variable": null}
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<variables>
|
||||
<variable name="variable1"/>
|
||||
<family name="base">
|
||||
<variable name="variable2"/>
|
||||
<family name="subfamily">
|
||||
<variable name="variable3"/>
|
||||
</family>
|
||||
<variable name="variable4"/>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue