Compare commits
19 Commits
pkg/dev/ri
...
ef83c3d257
Author | SHA1 | Date | |
---|---|---|---|
ef83c3d257 | |||
9c1589ca53 | |||
20f329d433 | |||
8d32ec9f01 | |||
b35d930d7e | |||
d7a1a52ebb | |||
d3008dc217 | |||
254a861472 | |||
a87485abd2 | |||
84eafb2deb | |||
0e55679e8b | |||
12111397e6 | |||
36827b6869 | |||
e354352dc8 | |||
a0fd998aeb | |||
e5737cd572 | |||
65d40f494f | |||
4fd5d38ca0 | |||
cda68e88a2 |
@ -28,7 +28,6 @@ Rougail est un bibliothèque python3 qui permet de charger des dictionnaires (fi
|
|||||||
- [Les calcules automatiques](fill/README.md)
|
- [Les calcules automatiques](fill/README.md)
|
||||||
- [Les vérifications des valeurs](check/README.md)
|
- [Les vérifications des valeurs](check/README.md)
|
||||||
- [Les conditions](condition/README.md)
|
- [Les conditions](condition/README.md)
|
||||||
- [Les variables meneuses ou suiveuses](variable/leadership.md)
|
|
||||||
|
|
||||||
## Les templates
|
## Les templates
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
# Les vérifications des valeurs
|
# Les vérifications des valeurs
|
||||||
|
|
||||||
- [Fonction de vérification](function.md)
|
- [Fonction de vérification](function.md)
|
||||||
- [Les variables à choix](valid_enum.md)
|
|
||||||
- [Réfinition](redefine.md)
|
- [Réfinition](redefine.md)
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
# Les variables à choix
|
|
||||||
|
|
||||||
Une variable à choix est d'abord une variable avec une [fonction check](function.md).
|
|
||||||
|
|
||||||
## Les variables à choix simple
|
|
||||||
|
|
||||||
Il est possible d'imposer une liste de valeur pour une variable particulière :
|
|
||||||
|
|
||||||
```
|
|
||||||
<check name="valid_enum">
|
|
||||||
<param>yes</param>
|
|
||||||
<param>no</param>
|
|
||||||
<param>maybe</param>
|
|
||||||
<target>my_variable</target>
|
|
||||||
</check>
|
|
||||||
```
|
|
||||||
|
|
||||||
Dans ce cas, seule les valeurs proposés sont possible pour cette variable.
|
|
||||||
|
|
||||||
Par défaut, cette variable est obligatoire. Cela signifie qu'il n'est pas possible de spécifier "None" à cette variable.
|
|
||||||
|
|
||||||
## Les variables à choix avec valeur None
|
|
||||||
|
|
||||||
Il y a deux possibilités pour avoir une valeur "None" dans les choix :
|
|
||||||
|
|
||||||
- rendre la variable non obligatoire, cela va ajouter un choix "None" dans la liste :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" mandatory="False">
|
|
||||||
```
|
|
||||||
|
|
||||||
Ou en ajoutant le paramètre "None" :
|
|
||||||
|
|
||||||
```
|
|
||||||
<check name="valid_enum">
|
|
||||||
<param>yes</param>
|
|
||||||
<param>no</param>
|
|
||||||
<param type='nil'/>
|
|
||||||
<param>maybe</param>
|
|
||||||
<target>my_variable</target>
|
|
||||||
</check>
|
|
||||||
```
|
|
||||||
|
|
||||||
## La valeur par défaut
|
|
||||||
|
|
||||||
Si aucune valeur n'est spécifié pour la variable, automatiquement le premier choix va est placé comme valeur par défaut.
|
|
@ -2,4 +2,5 @@
|
|||||||
|
|
||||||
- [Une famille](simple.md)
|
- [Une famille](simple.md)
|
||||||
- [Famille crée dynamiquement](auto.md)
|
- [Famille crée dynamiquement](auto.md)
|
||||||
|
- [Les variables meneuses ou suiveuses](leadership.md)
|
||||||
|
|
||||||
|
56
doc/family/leadership.md
Normal file
56
doc/family/leadership.md
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# Variable meneuse ou suiveuse
|
||||||
|
|
||||||
|
## Variable meneuse
|
||||||
|
|
||||||
|
Une variable meneuse est une variable qui va guider la longueur d'autre variables (appelé variables suiveuse).
|
||||||
|
|
||||||
|
Une variable meneuse est une [variable](../variable/README.md) qui est obligatoirement de type multiple.
|
||||||
|
|
||||||
|
Une variable meneuse peut être obligatoire.
|
||||||
|
|
||||||
|
Le [mode](../mode.md) par défaut correspond au plus petit mode définit par l'utilisateur des variables suiveuses.
|
||||||
|
|
||||||
|
## Variable suiveuse
|
||||||
|
|
||||||
|
Une variable suiveuse est une variable donc la longueur n'est pas déterminé par elle-même, mais est identique à celle de la variable meneuse dont elle dépend.
|
||||||
|
|
||||||
|
Une variable suiveuse est une variable placer juste derrière une variable meneuse ou une autre variable suiveuse.
|
||||||
|
|
||||||
|
L'ordre de définition des variables suiveuses est important.
|
||||||
|
|
||||||
|
Cette variable peut être de type multiple. Dans ce cas, pour un index determiné, il est possible de mettre plusieurs valeurs à une même variable.
|
||||||
|
|
||||||
|
Une variable suiveuse peut être obligatoire. Cela signifie que lorsqu'une variable meneuse est renseigné, il faut obligatoirement que la variable suiveuse est également une valeur à l'index considéré.
|
||||||
|
Si aucune valeur n'est définit pour la variable meneuse, aucune valeur n'est a spécifié pour la variable suiveuse.
|
||||||
|
|
||||||
|
Le [mode](../mode.md) par défaut d'une variable suiveuse correspond au [mode](../mode.md) de la variable meneuse.
|
||||||
|
|
||||||
|
Si une variable meneuse est caché ou désactivé, les variables suiveuses le seront également.
|
||||||
|
|
||||||
|
## Définition des variables meneuse et suiveuse
|
||||||
|
|
||||||
|
Les variables meneuses et suiveuses doivent dans une famille de type "leadership".
|
||||||
|
|
||||||
|
Voici un exemple de définition d'une variable meneuse et de deux variables meneuses :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variables>
|
||||||
|
<family name="family" leadership='True'>
|
||||||
|
<variable name="leader" multi='True'/>
|
||||||
|
<variable name="follower1"/>
|
||||||
|
<variable name="follower2" multi='True'/>
|
||||||
|
</family>
|
||||||
|
</variables>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Ajout d'une nouvelle variable suiveuse
|
||||||
|
|
||||||
|
Pour ajouter, dans un nouveau dictionnaire, une variable suiveuse à notre groupe, rien de plus simple, il suffit définir une ou des nouvelles variables dans la famille :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variables>
|
||||||
|
<family name="family">
|
||||||
|
<variable name="follower3"/>
|
||||||
|
</family>
|
||||||
|
</variables>
|
||||||
|
```
|
@ -49,8 +49,8 @@ Si une condition "hidden_if_in" est spécifié à la variable, la valeur sera mo
|
|||||||
|
|
||||||
## Variable meneuse ou suiveuse avec valeur calculé
|
## Variable meneuse ou suiveuse avec valeur calculé
|
||||||
|
|
||||||
Une [variable suiveuse](../variable/leadership.md) ne peut pas être calculé automatiquement.
|
Une [variable suiveuse](../family/leadership.md) ne peut pas être calculé automatiquement.
|
||||||
Une [variable meneuse](../variable/leadership.md) peut être calculé automatiquement.
|
Une [variable meneuse](../family/leadership.md) peut être calculé automatiquement.
|
||||||
Si la variable n'est pas multiple, il ne faut pas que le calcule retourne une liste.
|
Si la variable n'est pas multiple, il ne faut pas que le calcule retourne une liste.
|
||||||
|
|
||||||
## Variable dynamique avec une valeur calculée
|
## Variable dynamique avec une valeur calculée
|
||||||
|
@ -6,7 +6,7 @@ Imaginons que la variable "my_variable" pré-existe. La valeur de la variable se
|
|||||||
<param type="variable">my_variable</param>
|
<param type="variable">my_variable</param>
|
||||||
```
|
```
|
||||||
|
|
||||||
[Les variables meneuses ou suiveuses](../variable/leadership.md) peuvent être utilisé sans soucis comme paramètre.
|
[Les variables meneuses ou suiveuses](../family/leadership.md) peuvent être utilisé sans soucis comme paramètre.
|
||||||
|
|
||||||
## Paramètre avec variable potentiellement non existante
|
## Paramètre avec variable potentiellement non existante
|
||||||
|
|
||||||
|
@ -29,6 +29,16 @@ Un service non géré ne peut conteneur que des fichiers.
|
|||||||
|
|
||||||
## Désactiver la génération d'un service
|
## Désactiver la génération d'un service
|
||||||
|
|
||||||
|
Il est possible de désactiver un service. Pour cela il faut rajouter l'attribut "disabled" à True :
|
||||||
|
|
||||||
|
```
|
||||||
|
<services>
|
||||||
|
<service name="test" disabled="True"/>
|
||||||
|
</services>
|
||||||
|
```
|
||||||
|
|
||||||
|
Dans ce cas, tous les services et les éléments qu'il compose ([fichier](file.md), ...) seront désactivés.
|
||||||
|
|
||||||
Il est possible de définir une [condition](../condition/README.md) de type "disabled_if_in" ou "disabled_if_not_in" sur une balise service :
|
Il est possible de définir une [condition](../condition/README.md) de type "disabled_if_in" ou "disabled_if_not_in" sur une balise service :
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -1,4 +1,254 @@
|
|||||||
# Variable
|
# Variable
|
||||||
|
|
||||||
- [Une variable](simple.md)
|
## Un variable
|
||||||
- [Variable meneuse ou suiveuse](leadership.md)
|
|
||||||
|
Une variable est forcement dans [variables](../variables.md) ou dans 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
|
||||||
|
|
||||||
|
En plus d'un nom, il est possible de mettre une "description" à la variable. C'est une information "utilisateur" qui nous permettra d'avoir des informations complémentaires sur le contenu de cette variable :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" description="This is a greate variable"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
En plus de la description, il est possible de préciser une aide complémentaire :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" help="This is a greate variable"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
Cette aide peut être utilisé à tout moment comme valeur [d'un paramètre](../param/information.md).
|
||||||
|
|
||||||
|
## Le type de la variable
|
||||||
|
|
||||||
|
Une variable a un type. Ce type permet de définir les valeurs acceptées par cette variable :
|
||||||
|
|
||||||
|
- string : chaine de caractère (type par défaut)
|
||||||
|
- number : un nombre
|
||||||
|
- float : un chiffre flottant
|
||||||
|
- boolean : "True" ou "False", si aucune valeur n'est défini la valeur par défaut de cette variable sera "True", ces variables sont également obligatoire par défaut
|
||||||
|
- password : un mot de passe
|
||||||
|
- mail : une adresse mail
|
||||||
|
- filename : nom de fichier au sens Unix (exemple : "/etc/passwd")
|
||||||
|
- date : une date au format "%Y-%m-%d" (exemple : "2021-01-30")
|
||||||
|
- unix_user : nom d'utilisateur au sens Unix
|
||||||
|
- ip : n'importe quelle adresse IPv4
|
||||||
|
- cidr : n'importe quelle adresse IPv4 au format CIDR
|
||||||
|
- local_ip : adresse IPv4 sur un réseau local, si l'adresse IPv4 n'est pas local, un warning sera afficher mais la valeur sera accepté tout de même
|
||||||
|
- netmask : masque d'une adresse IPv4
|
||||||
|
- network : adresse réseau
|
||||||
|
- network_cidr : adresse réseau au format CIDR
|
||||||
|
- broadcast : adresse de diffusion
|
||||||
|
- netbios : nom netbios
|
||||||
|
- domain : nom de domaine
|
||||||
|
- hostname : nom d'hôte
|
||||||
|
- web_address : adresse web (http://www.cadoles.com/)
|
||||||
|
- port : port
|
||||||
|
- mac : adresse MAC
|
||||||
|
- schedule : périodicité du schedule, les valeurs possibles sont "none", "daily", "weekly" ou "monthly"
|
||||||
|
- schedulemod : type de schedule, les valeurs possibles sont "pre" ou "post"
|
||||||
|
|
||||||
|
Pour définir le type d'une variable :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" type="number"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Variable à valeur multiple
|
||||||
|
|
||||||
|
Par défaut une variable ne peut acceuillir qu'une seule valeur. Il peut être utile de pouvoir spécifier plusieurs valeurs à une même variable.
|
||||||
|
|
||||||
|
Pour définir une variable à valeur multiple :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" multi="True"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Variable invisible
|
||||||
|
|
||||||
|
Il est possible de cacher une variable.
|
||||||
|
|
||||||
|
Cacher une variable signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service.
|
||||||
|
Par contre cette variable sera accessibles lorsqu'on va l'utiliser.
|
||||||
|
|
||||||
|
Pour cacher une variable :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" hidden="True"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Variable désactive
|
||||||
|
|
||||||
|
Il est possible de désactiver une variable.
|
||||||
|
|
||||||
|
Désactiver une variable signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service mais également lorsqu'on va l'utiliser.
|
||||||
|
|
||||||
|
Pour désactiver une variable :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" disabled="True"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Variable obligatoire
|
||||||
|
|
||||||
|
Variable dont une valeur est requise :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" mandatory="True"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
Les variables booléans sont par défaut obligatoire. Pour qu'une variable booléan ne soit pas obligatoire il faut le préciser explicitement :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" type="boolean" mandatory="False"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
Les variables avec une valeur par défaut (non calculée) sont également automatiquement obligatoire.
|
||||||
|
|
||||||
|
## Valeur par défaut d'une variable
|
||||||
|
|
||||||
|
Il est possible de fixer les valeurs par défaut d'une variable :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable">
|
||||||
|
<value>value</value>
|
||||||
|
</variable>
|
||||||
|
```
|
||||||
|
|
||||||
|
Pour une variable multiple, il est possible de préciser plusieurs valeurs :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" multi="True">
|
||||||
|
<value>value 1</value>
|
||||||
|
<value>value 2</value>
|
||||||
|
</variable>
|
||||||
|
```
|
||||||
|
|
||||||
|
Si la variable n'est pas pas une [variable meneuse](../family/leadership.md), la première valeur défini dans cette liste sera également la valeur par défaut proposé si on ajoute une nouvelle valeur à cette variable.
|
||||||
|
|
||||||
|
Une valeur par défaut peut également être [une valeur calculer](../fill/README.md).
|
||||||
|
|
||||||
|
## Redéfinir une variable
|
||||||
|
|
||||||
|
Il est possible de définir une variable dans un dictionnaire et de changer son comportement dans une second dictionnaire.
|
||||||
|
|
||||||
|
Attention trois attributs ne sont redéfinisable :
|
||||||
|
|
||||||
|
- name
|
||||||
|
- type
|
||||||
|
- multi
|
||||||
|
|
||||||
|
Créons notre variable :
|
||||||
|
|
||||||
|
<variable name="my_variable"/>
|
||||||
|
|
||||||
|
Et redéfinisons là :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" redefine="True" description="New description"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Créer une variable inexistante
|
||||||
|
|
||||||
|
Il est parfois utile de créer une variable si elle n'existe pas dans un autre dictionnaire :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" exists="False"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
Si cette variable existe dans un autre dictionnaire, elle ne sera pas modifié ni recréé
|
||||||
|
|
||||||
|
## Redéfinir une variable si elle existe
|
||||||
|
|
||||||
|
Parfois on veut pouvoir redéfinir une variable mais seulement dans le cas où elle existe déjà :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" redefine="True" exists="True" hidden="True"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Variable à valeur automatiquement modifiée
|
||||||
|
|
||||||
|
Une variable avec valeur automatiquement modifiée est une variable dont la valeur sera considéré comme modifié quand la propriété global "force_store_value" de Tiramisu est mise.
|
||||||
|
|
||||||
|
Voici une variable a valeur automatiquement modifiée :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" auto_save="True">
|
||||||
|
<value>my_value</value>
|
||||||
|
</variable>
|
||||||
|
```
|
||||||
|
|
||||||
|
Dans ce cas la valeur est fixée à la valeur actuelle.
|
||||||
|
Par exemple, si la valeur de cette variable est issue d'un calcul, la valeur ne sera plus recalculée.
|
||||||
|
|
||||||
|
Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont automatiquement modifiées que si elles ont une valeurs.
|
||||||
|
|
||||||
|
Une [variable meneuse ou suiveuse](../family/leadership.md) ne peut pas avoir la propriété auto_save.
|
||||||
|
|
||||||
|
## Variable à valeur en lecture seule automatique
|
||||||
|
|
||||||
|
Une variable avec valeur en lecture seule automatique est une variable dont la valeur ne sera plus modifiable par l'utilisateur quand la [variable "server_deployed" passe à "True"](../dev/config.md).
|
||||||
|
|
||||||
|
Voici un variable à valeur en lecture seule automatique :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="server_deployed" type="boolean">
|
||||||
|
<value>False</value>
|
||||||
|
</variable>
|
||||||
|
<variable name="my_variable" auto_freeze="True"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
Dans ce cas la valeur est fixée à la valeur actuelle et elle ne sera plus modifiable par l'utilisateur.
|
||||||
|
Par exemple, si la valeur de cette variable est issue d'un calcul, la valeur ne sera plus recalculée.
|
||||||
|
|
||||||
|
Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont en lecteur seul que si elles ont une valeurs.
|
||||||
|
|
||||||
|
Une [variable meneuse ou suiveuse](../family/leadership.md) ne peut pas avoir la propriété auto_freeze.
|
||||||
|
|
||||||
|
## Information "test"
|
||||||
|
|
||||||
|
L'attribut "test" est un attribut spécial qui permet aux concepteurs d'un dictionnaire d'influancer le robot de test en précisant de valeurs utile à tester.
|
||||||
|
|
||||||
|
Concrêtement, le contenu de cet attribut est enregister dans une "information" de l'option Tiramisu correspondante.
|
||||||
|
|
||||||
|
Exemple :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" test="yes"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
Il est possible de préciser plusieurs valeurs avec le séparateur "|" :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" test="yes|no"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
Cette valeur peut être utilisé à tout moment comme valeur [d'un paramètre](../param/information.md).
|
||||||
|
|
||||||
|
## Mode de la variable
|
||||||
|
|
||||||
|
Le [mode](../mode.md) par défaut d'une variable correspond au [mode](../mode.md) de la [famille](../family/README.md).
|
||||||
|
|
||||||
|
Cas particuliers :
|
||||||
|
|
||||||
|
- une variable à valeur automatiquement modifiée ou une variable en lecture seule automatique est par défaut en mode "basic".
|
||||||
|
- si la variable n'est pas dans une famille, la variable aura le mode "normal" par défaut.
|
||||||
|
- une variable obligatoire sans valeur par défaut (calculer ou non) aura le mode "basic".
|
||||||
|
|
||||||
|
Pour définir le [mode](../mode.md) :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" mode="expert"/>
|
||||||
|
```
|
||||||
|
91
doc/variable/choice.md
Normal file
91
doc/variable/choice.md
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# Les variables à choix
|
||||||
|
|
||||||
|
## Une variable à choix
|
||||||
|
|
||||||
|
Il est possible d'imposer une liste de valeur pour une variable particulière :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" type="choice">
|
||||||
|
<choice>val1</choice>
|
||||||
|
<choice>val2</choice>
|
||||||
|
<choice>val3</choice>
|
||||||
|
</variable>
|
||||||
|
```
|
||||||
|
|
||||||
|
Dans ce cas, seules les valeurs proposées sont possibles pour cette variable.
|
||||||
|
Cette variable n'est pas obligatoire dont il est possible de mettre la valeur "None".
|
||||||
|
|
||||||
|
Si la variable est obligatoire ou si une valeur est précisée (la variable passe obligatoire) alors la valeur "None" n'est plus autorisé :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" type="choice">
|
||||||
|
<choice>val1</choice>
|
||||||
|
<choice>val2</choice>
|
||||||
|
<choice>val3</choice>
|
||||||
|
<value>val1</value>
|
||||||
|
</variable>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Un variable à choix typée
|
||||||
|
|
||||||
|
Par défaut les choix sont de type "string". Il est possible de préciser des nombres, des booléens ou la valeur None :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" type="choice">
|
||||||
|
<choice>val1</choice>
|
||||||
|
<choice type="string">val2</choice>
|
||||||
|
<choice type="number">3</choice>
|
||||||
|
<choice type="boolean">True</choice>
|
||||||
|
<choice type="nil"/>
|
||||||
|
</variable>
|
||||||
|
```
|
||||||
|
|
||||||
|
Comme vu précédement ajouter la valeur None n'est pas utile parce qu'elle est automatiquement ajouté si la variable n'est pas obligatoire.
|
||||||
|
|
||||||
|
## Ajouter une option à une variable à choix existante
|
||||||
|
|
||||||
|
Pour ajouter un choix à une variable à choix existante, rien de plus simple, juste redéfinir la variable en ajoutant le choix voulu :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" redefine="True">
|
||||||
|
<choice>val4</choice>
|
||||||
|
</variable>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Redéfinir une option à choix
|
||||||
|
|
||||||
|
Si on veut supprimer un choix ou redéfinir complètement la liste, il faut redéfinir cette variable et ajouter l'attribut "remove_choice" à "True" :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" redefine="True" remove_choice="True">
|
||||||
|
<choice>val1</choice>
|
||||||
|
<choice>val2</choice>
|
||||||
|
</variable>
|
||||||
|
```
|
||||||
|
|
||||||
|
Dans ce cas toutes les anciens choix ne seront plus possible. Seuls les nouveaux le seront.
|
||||||
|
|
||||||
|
## Un variable à choix provenant d'une variable
|
||||||
|
|
||||||
|
Une variable à valeur multiple peut servir de source des choix :
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" type="choice">
|
||||||
|
<choice type="variable">other_variable</choice>
|
||||||
|
</variable>
|
||||||
|
```
|
||||||
|
|
||||||
|
Dans ce cas, toutes les valeurs de la variable seront des choix utilisables par l'utilisateur.
|
||||||
|
Seul un choice de type "variable" est possible par variable.
|
||||||
|
|
||||||
|
## Un variable à choix provenant d'une fonction
|
||||||
|
|
||||||
|
```
|
||||||
|
<variable name="my_variable" type="choice">
|
||||||
|
<choice type="function" name="trange">
|
||||||
|
<param type="number">0</param>
|
||||||
|
<param type="number">10</param>
|
||||||
|
</choice>
|
||||||
|
<value type="number">9</value>
|
||||||
|
</variable>
|
||||||
|
```
|
@ -1,255 +0,0 @@
|
|||||||
# Variable
|
|
||||||
|
|
||||||
## Un variable
|
|
||||||
|
|
||||||
Une variable est forcement dans [variables](../variables.md) ou dans 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
|
|
||||||
|
|
||||||
En plus d'un nom, il est possible de mettre une "description" à la variable. C'est une information "utilisateur" qui nous permettra d'avoir des informations complémentaires sur le contenu de cette variable :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" description="This is a greate variable"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
En plus de la description, il est possible de préciser une aide complémentaire :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" help="This is a greate variable"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
Cette aide peut être utilisé à tout moment comme valeur [d'un paramètre](../param/information.md).
|
|
||||||
|
|
||||||
## Le type de la variable
|
|
||||||
|
|
||||||
Une variable a un type. Ce type permet de définir les valeurs acceptées par cette variable :
|
|
||||||
|
|
||||||
- string : chaine de caractère (type par défaut)
|
|
||||||
- number : un nombre
|
|
||||||
- float : un chiffre flottant
|
|
||||||
- boolean : "True" ou "False", si aucune valeur n'est défini la valeur par défaut de cette variable sera "True", ces variables sont également obligatoire par défaut
|
|
||||||
- password : un mot de passe
|
|
||||||
- mail : une adresse mail
|
|
||||||
- filename : nom de fichier au sens Unix (exemple : "/etc/passwd")
|
|
||||||
- date : une date au format "%Y-%m-%d" (exemple : "2021-01-30")
|
|
||||||
- unix_user : nom d'utilisateur au sens Unix
|
|
||||||
- ip : n'importe quelle adresse IPv4
|
|
||||||
- cidr : n'importe quelle adresse IPv4 au format CIDR
|
|
||||||
- local_ip : adresse IPv4 sur un réseau local, si l'adresse IPv4 n'est pas local, un warning sera afficher mais la valeur sera accepté tout de même
|
|
||||||
- netmask : masque d'une adresse IPv4
|
|
||||||
- network : adresse réseau
|
|
||||||
- network_cidr : adresse réseau au format CIDR
|
|
||||||
- broadcast : adresse de diffusion
|
|
||||||
- netbios : nom netbios
|
|
||||||
- domain : nom de domaine
|
|
||||||
- hostname : nom d'hôte
|
|
||||||
- web_address : adresse web (http://www.cadoles.com/)
|
|
||||||
- port : port
|
|
||||||
- mac : adresse MAC
|
|
||||||
- schedule : périodicité du schedule, les valeurs possibles sont "none", "daily", "weekly" ou "monthly"
|
|
||||||
- schedulemod : type de schedule, les valeurs possibles sont "pre" ou "post"
|
|
||||||
|
|
||||||
Pour définir le type d'une variable :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" type="number"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Variable à valeur multiple
|
|
||||||
|
|
||||||
Par défaut une variable ne peut acceuillir qu'une seule valeur. Il peut être utile de pouvoir spécifier plusieurs valeurs à une même variable.
|
|
||||||
|
|
||||||
Pour définir une variable à valeur multiple :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" multi="True"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Variable invisible
|
|
||||||
|
|
||||||
Il est possible de cacher une variable.
|
|
||||||
|
|
||||||
Cacher une variable signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service.
|
|
||||||
Par contre cette variable sera accessibles lorsqu'on va l'utiliser.
|
|
||||||
|
|
||||||
Pour cacher une variable :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" hidden="True"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Variable désactive
|
|
||||||
|
|
||||||
Il est possible de désactiver une variable.
|
|
||||||
|
|
||||||
Désactiver une variable signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service mais également lorsqu'on va l'utiliser.
|
|
||||||
|
|
||||||
Pour désactiver une variable :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" disabled="True"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Variable obligatoire
|
|
||||||
|
|
||||||
Variable dont une valeur est requise :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" mandatory="True"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
Les variables booléans sont par défaut obligatoire. Pour qu'une variable booléan ne soit pas obligatoire il faut le préciser explicitement :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" type="boolean" mandatory="False"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
Les variables avec une valeur par défaut (non calculée) sont également automatiquement obligatoire.
|
|
||||||
[Les variables à choix](../check/valid_enum.md) sans choix "None" sont également automatiquement obligatoire.
|
|
||||||
|
|
||||||
## Valeur par défaut d'une variable
|
|
||||||
|
|
||||||
Il est possible de fixer les valeurs par défaut d'une variable :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable">
|
|
||||||
<value>value</value>
|
|
||||||
</variable>
|
|
||||||
```
|
|
||||||
|
|
||||||
Pour une variable multiple, il est possible de préciser plusieurs valeurs :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" multi="True">
|
|
||||||
<value>value 1</value>
|
|
||||||
<value>value 2</value>
|
|
||||||
</variable>
|
|
||||||
```
|
|
||||||
|
|
||||||
Si la variable n'est pas pas une [variable meneuse](leadership.md), la première valeur défini dans cette liste sera également la valeur par défaut proposé si on ajoute une nouvelle valeur à cette variable.
|
|
||||||
|
|
||||||
Une valeur par défaut peut également être [une valeur calculer](../fill/README.md).
|
|
||||||
|
|
||||||
## Redéfinir une variable
|
|
||||||
|
|
||||||
Il est possible de définir une variable dans un dictionnaire et de changer son comportement dans une second dictionnaire.
|
|
||||||
|
|
||||||
Attention trois attributs ne sont redéfinisable :
|
|
||||||
|
|
||||||
- name
|
|
||||||
- type
|
|
||||||
- multi
|
|
||||||
|
|
||||||
Créons notre variable :
|
|
||||||
|
|
||||||
<variable name="my_variable"/>
|
|
||||||
|
|
||||||
Et redéfinisons là :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" redefine="True" description="New description"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Créer une variable inexistante
|
|
||||||
|
|
||||||
Il est parfois utile de créer une variable si elle n'existe pas dans un autre dictionnaire :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" exists="False"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
Si cette variable existe dans un autre dictionnaire, elle ne sera pas modifié ni recréé
|
|
||||||
|
|
||||||
## Redéfinir une variable si elle existe
|
|
||||||
|
|
||||||
Parfois on veut pouvoir redéfinir une variable mais seulement dans le cas où elle existe déjà :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" redefine="True" exists="True" hidden="True"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Variable à valeur automatiquement modifiée
|
|
||||||
|
|
||||||
Une variable avec valeur automatiquement modifiée est une variable dont la valeur sera considéré comme modifié quand la propriété global "force_store_value" de Tiramisu est mise.
|
|
||||||
|
|
||||||
Voici une variable a valeur automatiquement modifiée :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" auto_save="True">
|
|
||||||
<value>my_value</value>
|
|
||||||
</variable>
|
|
||||||
```
|
|
||||||
|
|
||||||
Dans ce cas la valeur est fixée à la valeur actuelle.
|
|
||||||
Par exemple, si la valeur de cette variable est issue d'un calcul, la valeur ne sera plus recalculée.
|
|
||||||
|
|
||||||
Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont automatiquement modifiées que si elles ont une valeurs.
|
|
||||||
|
|
||||||
Une [variable meneuse ou suiveuse](leadership.md) ne peut pas avoir la propriété auto_save.
|
|
||||||
|
|
||||||
## Variable à valeur en lecture seule automatique
|
|
||||||
|
|
||||||
Une variable avec valeur en lecture seule automatique est une variable dont la valeur ne sera plus modifiable par l'utilisateur quand la [variable "server_deployed" passe à "True"](../dev/config.md).
|
|
||||||
|
|
||||||
Voici un variable à valeur en lecture seule automatique :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="server_deployed" type="boolean">
|
|
||||||
<value>False</value>
|
|
||||||
</variable>
|
|
||||||
<variable name="my_variable" auto_freeze="True"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
Dans ce cas la valeur est fixée à la valeur actuelle et elle ne sera plus modifiable par l'utilisateur.
|
|
||||||
Par exemple, si la valeur de cette variable est issue d'un calcul, la valeur ne sera plus recalculée.
|
|
||||||
|
|
||||||
Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont en lecteur seul que si elles ont une valeurs.
|
|
||||||
|
|
||||||
Une [variable meneuse ou suiveuse](leadership.md) ne peut pas avoir la propriété auto_freeze.
|
|
||||||
|
|
||||||
## Information "test"
|
|
||||||
|
|
||||||
L'attribut "test" est un attribut spécial qui permet aux concepteurs d'un dictionnaire d'influancer le robot de test en précisant de valeurs utile à tester.
|
|
||||||
|
|
||||||
Concrêtement, le contenu de cet attribut est enregister dans une "information" de l'option Tiramisu correspondante.
|
|
||||||
|
|
||||||
Exemple :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" test="yes"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
Il est possible de préciser plusieurs valeurs avec le séparateur "|" :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" test="yes|no"/>
|
|
||||||
```
|
|
||||||
|
|
||||||
Cette valeur peut être utilisé à tout moment comme valeur [d'un paramètre](../param/information.md).
|
|
||||||
|
|
||||||
## Mode de la variable
|
|
||||||
|
|
||||||
Le [mode](../mode.md) par défaut d'une variable correspond au [mode](../mode.md) de la [famille](../family/README.md).
|
|
||||||
|
|
||||||
Cas particuliers :
|
|
||||||
|
|
||||||
- une variable à valeur automatiquement modifiée ou une variable en lecture seule automatique est par défaut en mode "basic".
|
|
||||||
- si la variable n'est pas dans une famille, la variable aura le mode "normal" par défaut.
|
|
||||||
- une variable obligatoire sans valeur par défaut (calculer ou non) aura le mode "basic".
|
|
||||||
|
|
||||||
Pour définir le [mode](../mode.md) :
|
|
||||||
|
|
||||||
```
|
|
||||||
<variable name="my_variable" mode="expert"/>
|
|
||||||
```
|
|
@ -26,12 +26,27 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
"""
|
"""
|
||||||
from .variable import CONVERT_OPTION
|
from .variable import CONVERT_OPTION
|
||||||
import importlib.resources
|
import importlib.resources
|
||||||
|
from os.path import dirname, join
|
||||||
from ..utils import load_modules
|
from ..utils import load_modules
|
||||||
|
|
||||||
|
|
||||||
ANNOTATORS = None
|
ANNOTATORS = None
|
||||||
|
|
||||||
|
|
||||||
|
if not 'files' in dir(importlib.resources):
|
||||||
|
# old python version
|
||||||
|
class fake_files:
|
||||||
|
def __init__(self, package):
|
||||||
|
self.mod = []
|
||||||
|
dir_package = dirname(importlib.resources._get_package(package).__file__)
|
||||||
|
for mod in importlib.resources.contents(package):
|
||||||
|
self.mod.append(join(dir_package, mod))
|
||||||
|
|
||||||
|
def iterdir(self):
|
||||||
|
return self.mod
|
||||||
|
importlib.resources.files = fake_files
|
||||||
|
|
||||||
|
|
||||||
def get_level(module):
|
def get_level(module):
|
||||||
return module.level
|
return module.level
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ from rougail.utils import load_modules
|
|||||||
from rougail.i18n import _
|
from rougail.i18n import _
|
||||||
from rougail.error import DictConsistencyError, display_xmlfiles
|
from rougail.error import DictConsistencyError, display_xmlfiles
|
||||||
|
|
||||||
INTERNAL_FUNCTIONS = ['valid_enum', 'valid_in_network', 'valid_differ', 'valid_entier']
|
INTERNAL_FUNCTIONS = ['valid_in_network', 'valid_differ', 'valid_entier']
|
||||||
|
|
||||||
class Annotator(TargetAnnotator, ParamAnnotator):
|
class Annotator(TargetAnnotator, ParamAnnotator):
|
||||||
"""Annotate check
|
"""Annotate check
|
||||||
@ -58,21 +58,11 @@ class Annotator(TargetAnnotator, ParamAnnotator):
|
|||||||
self.convert_target(self.objectspace.space.constraints.check)
|
self.convert_target(self.objectspace.space.constraints.check)
|
||||||
self.convert_param(self.objectspace.space.constraints.check)
|
self.convert_param(self.objectspace.space.constraints.check)
|
||||||
self.check_check()
|
self.check_check()
|
||||||
self.check_valid_enum()
|
|
||||||
self.check_change_warning()
|
self.check_change_warning()
|
||||||
self.convert_valid_entier()
|
self.convert_valid_entier()
|
||||||
self.convert_check()
|
self.convert_check()
|
||||||
del objectspace.space.constraints.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:
|
|
||||||
variable_type = target.name.type
|
|
||||||
return variable_type
|
|
||||||
|
|
||||||
def check_check(self): # pylint: disable=R0912
|
def check_check(self): # pylint: disable=R0912
|
||||||
"""valid and manage <check>
|
"""valid and manage <check>
|
||||||
"""
|
"""
|
||||||
@ -87,119 +77,6 @@ class Annotator(TargetAnnotator, ParamAnnotator):
|
|||||||
for idx in remove_indexes:
|
for idx in remove_indexes:
|
||||||
del self.objectspace.space.constraints.check[idx]
|
del self.objectspace.space.constraints.check[idx]
|
||||||
|
|
||||||
def check_valid_enum(self):
|
|
||||||
"""verify valid_enum
|
|
||||||
"""
|
|
||||||
remove_indexes = []
|
|
||||||
for idx, check in enumerate(self.objectspace.space.constraints.check):
|
|
||||||
if check.name != 'valid_enum':
|
|
||||||
continue
|
|
||||||
for target in check.target:
|
|
||||||
if target.name.path in self.objectspace.valid_enums:
|
|
||||||
check_xmlfiles = display_xmlfiles(self.objectspace.valid_enums\
|
|
||||||
[target.name.path]['xmlfiles'])
|
|
||||||
msg = _(f'valid_enum already set in {check_xmlfiles} '
|
|
||||||
f'for "{target.name.name}", you may have forget remove_check')
|
|
||||||
raise DictConsistencyError(msg, 3, check.xmlfiles)
|
|
||||||
if not hasattr(check, 'param'):
|
|
||||||
msg = _(f'param is mandatory for a valid_enum of variable "{target.name.name}"')
|
|
||||||
raise DictConsistencyError(msg, 4, check.xmlfiles)
|
|
||||||
variable_type = target.name.type
|
|
||||||
values = self._set_valid_enum(target.name,
|
|
||||||
check,
|
|
||||||
)
|
|
||||||
if values:
|
|
||||||
if hasattr(target.name, 'value'):
|
|
||||||
# check value
|
|
||||||
self.check_valid_enum_value(target.name, values)
|
|
||||||
else:
|
|
||||||
# no value, set the first choice as default value
|
|
||||||
new_value = self.objectspace.value(check.xmlfiles)
|
|
||||||
new_value.name = values[0]
|
|
||||||
new_value.type = variable_type
|
|
||||||
target.name.value = [new_value]
|
|
||||||
remove_indexes.append(idx)
|
|
||||||
remove_indexes.sort(reverse=True)
|
|
||||||
for idx in remove_indexes:
|
|
||||||
del self.objectspace.space.constraints.check[idx]
|
|
||||||
|
|
||||||
def _set_valid_enum(self,
|
|
||||||
variable,
|
|
||||||
check,
|
|
||||||
) -> List[Any]:
|
|
||||||
# build choice
|
|
||||||
variable.values = []
|
|
||||||
variable.ori_type = variable.type
|
|
||||||
variable.type = 'choice'
|
|
||||||
|
|
||||||
has_variable = False
|
|
||||||
values = []
|
|
||||||
has_nil = False
|
|
||||||
is_function = False
|
|
||||||
for param in check.param:
|
|
||||||
if has_variable:
|
|
||||||
msg = _(f'only one "variable" parameter is allowed for valid_enum '
|
|
||||||
f'of variable "{variable.name}"')
|
|
||||||
raise DictConsistencyError(msg, 5, param.xmlfiles)
|
|
||||||
if param.type == 'function':
|
|
||||||
is_function = True
|
|
||||||
choice = self.objectspace.choice(variable.xmlfiles)
|
|
||||||
choice.name = param.text
|
|
||||||
choice.type = 'function'
|
|
||||||
choice.param = []
|
|
||||||
variable.values.append(choice)
|
|
||||||
continue
|
|
||||||
if is_function:
|
|
||||||
variable.values[0].param.append(param)
|
|
||||||
continue
|
|
||||||
param_type = variable.ori_type
|
|
||||||
if param.type == 'variable':
|
|
||||||
has_variable = True
|
|
||||||
if param.optional is True:
|
|
||||||
msg = _(f'optional parameter in valid_enum for variable "{variable.name}" '
|
|
||||||
f'is not allowed')
|
|
||||||
raise DictConsistencyError(msg, 14, param.xmlfiles)
|
|
||||||
if not param.text.multi:
|
|
||||||
msg = _(f'only multi "variable" parameter is allowed for valid_enum '
|
|
||||||
f'of variable "{variable.name}"')
|
|
||||||
raise DictConsistencyError(msg, 6, param.xmlfiles)
|
|
||||||
param_type = 'variable'
|
|
||||||
elif param.type == 'nil':
|
|
||||||
has_nil = True
|
|
||||||
values.append(param.text)
|
|
||||||
choice = self.objectspace.choice(variable.xmlfiles)
|
|
||||||
choice.name = param.text
|
|
||||||
choice.type = param_type
|
|
||||||
variable.values.append(choice)
|
|
||||||
if is_function:
|
|
||||||
return None
|
|
||||||
if 'mandatory' not in vars(variable):
|
|
||||||
variable.mandatory = not has_nil
|
|
||||||
elif variable.mandatory is False:
|
|
||||||
choice = self.objectspace.choice(variable.xmlfiles)
|
|
||||||
choice.name = None
|
|
||||||
choice.type = 'nil'
|
|
||||||
variable.values.append(choice)
|
|
||||||
if has_variable:
|
|
||||||
return None
|
|
||||||
self.objectspace.valid_enums[variable.path] = {'type': variable.ori_type,
|
|
||||||
'values': values,
|
|
||||||
'xmlfiles': check.xmlfiles,
|
|
||||||
}
|
|
||||||
return values
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def check_valid_enum_value(variable,
|
|
||||||
values,
|
|
||||||
) -> None:
|
|
||||||
"""check that values in valid_enum are valid
|
|
||||||
"""
|
|
||||||
for value in variable.value:
|
|
||||||
if value.name not in values:
|
|
||||||
msg = _(f'value "{value.name}" of variable "{variable.name}" is not in list '
|
|
||||||
f'of all expected values ({values})')
|
|
||||||
raise DictConsistencyError(msg, 15, value.xmlfiles)
|
|
||||||
|
|
||||||
def check_change_warning(self):
|
def check_change_warning(self):
|
||||||
"""convert level to "warnings_only"
|
"""convert level to "warnings_only"
|
||||||
"""
|
"""
|
||||||
|
@ -67,7 +67,7 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
|||||||
obj,
|
obj,
|
||||||
) -> None:
|
) -> None:
|
||||||
if obj.source.type == 'choice':
|
if obj.source.type == 'choice':
|
||||||
return obj.source.ori_type
|
return None
|
||||||
return obj.source.type
|
return obj.source.type
|
||||||
|
|
||||||
def convert_auto_freeze(self):
|
def convert_auto_freeze(self):
|
||||||
@ -164,13 +164,12 @@ class Annotator(TargetAnnotator, ParamAnnotator, Walk):
|
|||||||
return target.name, [target.name]
|
return target.name, [target.name]
|
||||||
# it's a leader, so apply property to leadership
|
# it's a leader, so apply property to leadership
|
||||||
family_name = self.objectspace.paths.get_variable_family_path(target.name.path)
|
family_name = self.objectspace.paths.get_variable_family_path(target.name.path)
|
||||||
family = self.objectspace.paths.get_family(family_name,
|
namespace = target.name.namespace
|
||||||
target.name.namespace,
|
else:
|
||||||
)
|
family_name = target.name.path
|
||||||
return family, family.variable
|
namespace = target.namespace
|
||||||
# it's a family
|
variable = self.objectspace.paths.get_family(family_name,
|
||||||
variable = self.objectspace.paths.get_family(target.name.path,
|
namespace,
|
||||||
target.namespace,
|
|
||||||
)
|
)
|
||||||
if hasattr(variable, 'variable'):
|
if hasattr(variable, 'variable'):
|
||||||
return variable, list(variable.variable.values())
|
return variable, list(variable.variable.values())
|
||||||
|
@ -120,7 +120,7 @@ class Annotator(Walk):
|
|||||||
obj,
|
obj,
|
||||||
) -> None:
|
) -> None:
|
||||||
modes_level = self.objectspace.rougailconfig['modes_level']
|
modes_level = self.objectspace.rougailconfig['modes_level']
|
||||||
if hasattr(obj, 'mode') and obj.mode not in modes_level:
|
if self._has_mode(obj) and obj.mode not in modes_level:
|
||||||
msg = _(f'mode "{obj.mode}" for "{obj.name}" is not a valid mode, '
|
msg = _(f'mode "{obj.mode}" for "{obj.name}" is not a valid mode, '
|
||||||
f'valid modes are {modes_level}')
|
f'valid modes are {modes_level}')
|
||||||
raise DictConsistencyError(msg, 71, obj.xmlfiles)
|
raise DictConsistencyError(msg, 71, obj.xmlfiles)
|
||||||
@ -128,23 +128,29 @@ class Annotator(Walk):
|
|||||||
def _set_default_mode(self,
|
def _set_default_mode(self,
|
||||||
family: 'self.objectspace.family',
|
family: 'self.objectspace.family',
|
||||||
) -> None:
|
) -> None:
|
||||||
if hasattr(family, 'mode') and 'mode' in vars(family):
|
if not hasattr(family, 'variable'):
|
||||||
|
return
|
||||||
|
if self._has_mode(family):
|
||||||
family_mode = family.mode
|
family_mode = family.mode
|
||||||
else:
|
else:
|
||||||
family_mode = None
|
family_mode = None
|
||||||
if not hasattr(family, 'variable'):
|
leader = None
|
||||||
return
|
|
||||||
for variable in family.variable.values():
|
for variable in family.variable.values():
|
||||||
self.valid_mode(variable)
|
if leader is None and hasattr(family, 'leadership') and family.leadership:
|
||||||
|
leader = variable
|
||||||
if isinstance(variable, self.objectspace.family):
|
if isinstance(variable, self.objectspace.family):
|
||||||
|
# set default mode a subfamily
|
||||||
if family_mode and not self._has_mode(variable):
|
if family_mode and not self._has_mode(variable):
|
||||||
self._set_auto_mode(variable, family_mode)
|
self._set_auto_mode(variable, family_mode)
|
||||||
continue
|
|
||||||
if isinstance(variable, self.objectspace.leadership):
|
|
||||||
func = self._set_default_mode_leader
|
|
||||||
else:
|
else:
|
||||||
func = self._set_default_mode_variable
|
# set default mode to a variable
|
||||||
func(variable, family_mode)
|
self.valid_mode(variable)
|
||||||
|
if leader:
|
||||||
|
self._set_default_mode_leader(leader, variable)
|
||||||
|
self._set_default_mode_variable(variable, family_mode)
|
||||||
|
if leader:
|
||||||
|
# here because follower can change leader mode
|
||||||
|
self._set_auto_mode(family, leader.mode)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _has_mode(obj) -> bool:
|
def _has_mode(obj) -> bool:
|
||||||
@ -174,45 +180,35 @@ class Annotator(Walk):
|
|||||||
obj.mode_auto = True
|
obj.mode_auto = True
|
||||||
|
|
||||||
def _set_default_mode_leader(self,
|
def _set_default_mode_leader(self,
|
||||||
leadership: 'self.objectspace.leadership',
|
leader: 'self.objectspace.variable',
|
||||||
family_mode: str,
|
follower: 'self.objectspace.variable',
|
||||||
) -> None:
|
) -> None:
|
||||||
leader_mode = None
|
|
||||||
for follower in leadership.variable:
|
|
||||||
self.valid_mode(follower)
|
|
||||||
if follower.auto_save is True:
|
if follower.auto_save is True:
|
||||||
msg = _(f'leader/followers "{follower.name}" could not be auto_save')
|
msg = _(f'leader/followers "{follower.name}" could not be auto_save')
|
||||||
raise DictConsistencyError(msg, 29, leadership.xmlfiles)
|
raise DictConsistencyError(msg, 29, follower.xmlfiles)
|
||||||
if follower.auto_freeze is True:
|
if follower.auto_freeze is True:
|
||||||
msg = f'leader/followers "{follower.name}" could not be auto_freeze'
|
msg = f'leader/followers "{follower.name}" could not be auto_freeze'
|
||||||
raise DictConsistencyError(_(msg), 30, leadership.xmlfiles)
|
raise DictConsistencyError(_(msg), 30, follower.xmlfiles)
|
||||||
if leader_mode is not None:
|
if leader == follower:
|
||||||
if hasattr(follower, 'mode'):
|
# it's a leader
|
||||||
|
if not hasattr(leader, 'mode'):
|
||||||
|
self._set_auto_mode(leader, self.objectspace.rougailconfig['default_variable_mode'])
|
||||||
|
return
|
||||||
|
if self._has_mode(follower):
|
||||||
follower_mode = follower.mode
|
follower_mode = follower.mode
|
||||||
else:
|
else:
|
||||||
follower_mode = self.objectspace.rougailconfig['default_variable_mode']
|
follower_mode = self.objectspace.rougailconfig['default_variable_mode']
|
||||||
if self.modes[leader_mode] > self.modes[follower_mode]:
|
if self.modes[leader.mode] > self.modes[follower_mode]:
|
||||||
if self._has_mode(follower) and not self._has_mode(leadership.variable[0]):
|
if self._has_mode(follower) and not self._has_mode(leader):
|
||||||
# if follower has mode but not the leader
|
# if follower has mode but not the leader
|
||||||
self._set_auto_mode(leadership.variable[0], follower_mode)
|
self._set_auto_mode(leader, follower_mode)
|
||||||
else:
|
else:
|
||||||
# leader's mode is minimum level
|
# leader's mode is minimum level
|
||||||
if self._has_mode(follower):
|
if self._has_mode(follower):
|
||||||
msg = _(f'the follower "{follower.name}" is in "{follower_mode}" mode '
|
msg = _(f'the follower "{follower.name}" is in "{follower_mode}" mode '
|
||||||
f'but leader have the higher mode "{leader_mode}"')
|
f'but leader have the higher mode "{leader.mode}"')
|
||||||
raise DictConsistencyError(msg, 63, follower.xmlfiles)
|
raise DictConsistencyError(msg, 63, follower.xmlfiles)
|
||||||
self._set_auto_mode(follower, leader_mode)
|
self._set_auto_mode(follower, leader.mode)
|
||||||
self._set_default_mode_variable(follower,
|
|
||||||
family_mode,
|
|
||||||
)
|
|
||||||
if leader_mode is None:
|
|
||||||
if hasattr(leadership.variable[0], 'mode'):
|
|
||||||
leader_mode = leadership.variable[0].mode
|
|
||||||
else:
|
|
||||||
leader_mode = self.objectspace.rougailconfig['default_variable_mode']
|
|
||||||
if hasattr(leadership.variable[0], 'mode'):
|
|
||||||
leader_mode = leadership.variable[0].mode
|
|
||||||
self._set_auto_mode(leadership, leader_mode)
|
|
||||||
|
|
||||||
def _change_family_mode(self,
|
def _change_family_mode(self,
|
||||||
family: 'self.objectspace.family',
|
family: 'self.objectspace.family',
|
||||||
@ -223,39 +219,41 @@ class Annotator(Walk):
|
|||||||
family_mode = self.objectspace.rougailconfig['default_family_mode']
|
family_mode = self.objectspace.rougailconfig['default_family_mode']
|
||||||
min_variable_mode = self.objectspace.rougailconfig['modes_level'][-1]
|
min_variable_mode = self.objectspace.rougailconfig['modes_level'][-1]
|
||||||
# change variable mode, but not if variables are not in a family
|
# change variable mode, but not if variables are not in a family
|
||||||
|
is_leadership = hasattr(family, 'leadership') and family.leadership
|
||||||
if hasattr(family, 'variable'):
|
if hasattr(family, 'variable'):
|
||||||
for variable in family.variable.values():
|
for idx, variable in enumerate(family.variable.values()):
|
||||||
if not isinstance(variable, self.objectspace.family):
|
if isinstance(variable, self.objectspace.family):
|
||||||
if isinstance(variable, self.objectspace.leadership):
|
if not hasattr(variable, 'mode'):
|
||||||
func = self._change_variable_mode_leader
|
|
||||||
else:
|
|
||||||
func = self._change_variable_mode
|
|
||||||
func(variable,
|
|
||||||
family_mode,
|
|
||||||
)
|
|
||||||
elif not hasattr(variable, 'mode'):
|
|
||||||
variable.mode = self.objectspace.rougailconfig['default_family_mode']
|
variable.mode = self.objectspace.rougailconfig['default_family_mode']
|
||||||
|
elif idx == 0 and is_leadership:
|
||||||
|
variable.mode = None
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
self._change_variable_mode(variable, family_mode, is_leadership)
|
||||||
if self.modes[min_variable_mode] > self.modes[variable.mode]:
|
if self.modes[min_variable_mode] > self.modes[variable.mode]:
|
||||||
min_variable_mode = variable.mode
|
min_variable_mode = variable.mode
|
||||||
if isinstance(family, self.objectspace.family) and \
|
if not isinstance(family, self.objectspace.family) or is_leadership:
|
||||||
(not hasattr(family, 'mode') or family.mode != min_variable_mode):
|
# it's Variable, Service, ... and leadership
|
||||||
|
return
|
||||||
|
if not hasattr(family, 'mode'):
|
||||||
# set the lower variable mode to family
|
# set the lower variable mode to family
|
||||||
if self._has_mode(family):
|
self._set_auto_mode(family, min_variable_mode)
|
||||||
|
if family.mode != min_variable_mode:
|
||||||
msg = _(f'the family "{family.name}" is in "{family.mode}" mode but variables and '
|
msg = _(f'the family "{family.name}" is in "{family.mode}" mode but variables and '
|
||||||
f'families inside have the higher modes "{min_variable_mode}"')
|
f'families inside have the higher modes "{min_variable_mode}"')
|
||||||
raise DictConsistencyError(msg, 62, family.xmlfiles)
|
raise DictConsistencyError(msg, 62, family.xmlfiles)
|
||||||
self._set_auto_mode(family, min_variable_mode)
|
|
||||||
|
|
||||||
def _change_variable_mode(self,
|
def _change_variable_mode(self,
|
||||||
variable,
|
variable,
|
||||||
family_mode: str,
|
family_mode: str,
|
||||||
|
is_follower: bool,
|
||||||
) -> None:
|
) -> None:
|
||||||
if hasattr(variable, 'mode'):
|
if hasattr(variable, 'mode'):
|
||||||
variable_mode = variable.mode
|
variable_mode = variable.mode
|
||||||
else:
|
else:
|
||||||
variable_mode = self.objectspace.rougailconfig['default_variable_mode']
|
variable_mode = self.objectspace.rougailconfig['default_variable_mode']
|
||||||
# none basic variable in high level family has to be in high level
|
# none basic variable in high level family has to be in high level
|
||||||
if self.modes[variable_mode] < self.modes[family_mode]:
|
if not is_follower and self.modes[variable_mode] < self.modes[family_mode]:
|
||||||
if self._has_mode(variable):
|
if self._has_mode(variable):
|
||||||
msg = _(f'the variable "{variable.name}" is in "{variable_mode}" mode '
|
msg = _(f'the variable "{variable.name}" is in "{variable_mode}" mode '
|
||||||
f'but family has the higher family mode "{family_mode}"')
|
f'but family has the higher family mode "{family_mode}"')
|
||||||
@ -264,16 +262,6 @@ class Annotator(Walk):
|
|||||||
if not hasattr(variable, 'mode'):
|
if not hasattr(variable, 'mode'):
|
||||||
variable.mode = variable_mode
|
variable.mode = variable_mode
|
||||||
|
|
||||||
def _change_variable_mode_leader(self,
|
|
||||||
leadership,
|
|
||||||
family_mode: str,
|
|
||||||
) -> None:
|
|
||||||
for follower in leadership.variable:
|
|
||||||
self._change_variable_mode(follower,
|
|
||||||
family_mode,
|
|
||||||
)
|
|
||||||
leadership.variable[0].mode = None
|
|
||||||
|
|
||||||
def dynamic_families(self):
|
def dynamic_families(self):
|
||||||
"""link dynamic families to object
|
"""link dynamic families to object
|
||||||
"""
|
"""
|
||||||
@ -287,7 +275,7 @@ class Annotator(Walk):
|
|||||||
f'to multi variable')
|
f'to multi variable')
|
||||||
raise DictConsistencyError(msg, 16, family.xmlfiles)
|
raise DictConsistencyError(msg, 16, family.xmlfiles)
|
||||||
for variable in family.variable.values():
|
for variable in family.variable.values():
|
||||||
if isinstance(variable, self.objectspace.family):
|
if isinstance(variable, self.objectspace.family) and not variable.leadership:
|
||||||
msg = _(f'dynamic family "{family.name}" cannot contains another family')
|
msg = _(f'dynamic family "{family.name}" cannot contains another family')
|
||||||
raise DictConsistencyError(msg, 22, family.xmlfiles)
|
raise DictConsistencyError(msg, 22, family.xmlfiles)
|
||||||
|
|
||||||
|
@ -27,9 +27,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
from rougail.i18n import _
|
from rougail.i18n import _
|
||||||
from rougail.error import DictConsistencyError
|
from rougail.error import DictConsistencyError
|
||||||
from rougail.utils import normalize_family
|
from rougail.utils import normalize_family
|
||||||
|
from rougail.annotator.variable import Walk
|
||||||
|
|
||||||
|
|
||||||
class Annotator:
|
class Annotator(Walk):
|
||||||
"""Annotate group
|
"""Annotate group
|
||||||
"""
|
"""
|
||||||
level = 10
|
level = 10
|
||||||
@ -37,126 +38,40 @@ class Annotator:
|
|||||||
objectspace,
|
objectspace,
|
||||||
*args,
|
*args,
|
||||||
):
|
):
|
||||||
self.objectspace = objectspace
|
if not hasattr(objectspace.space, 'variables'):
|
||||||
if not hasattr(self.objectspace.space, 'constraints') or \
|
|
||||||
not hasattr(self.objectspace.space.constraints, 'group'):
|
|
||||||
return
|
return
|
||||||
|
self.objectspace = objectspace
|
||||||
self.convert_groups()
|
self.convert_groups()
|
||||||
|
|
||||||
def convert_groups(self): # pylint: disable=C0111
|
def convert_groups(self): # pylint: disable=C0111
|
||||||
"""convert groups
|
"""convert groups
|
||||||
"""
|
"""
|
||||||
# store old leaders family name
|
# store old leaders family name
|
||||||
cache_paths = {}
|
for family in self.get_families():
|
||||||
for group in self.objectspace.space.constraints.group:
|
if not isinstance(family, self.objectspace.family):
|
||||||
if group.leader in cache_paths:
|
continue
|
||||||
leader_fam_path = cache_paths[group.leader]
|
if not family.leadership:
|
||||||
else:
|
continue
|
||||||
leader_fam_path = self.objectspace.paths.get_variable_family_path(group.leader, group.xmlfiles)
|
if hasattr(family, 'dynamic'):
|
||||||
cache_paths[group.leader] = leader_fam_path
|
msg = _(f'the family "{family.name}" cannot be leadership and dynamic together')
|
||||||
follower_names = list(group.follower.keys())
|
raise DictConsistencyError(msg, 31, family.xmlfiles)
|
||||||
leader = self.objectspace.paths.get_variable(group.leader)
|
for idx, variable in enumerate(family.variable.values()):
|
||||||
if '.' not in leader_fam_path:
|
if idx == 0:
|
||||||
# it's a namespace
|
|
||||||
ori_leader_family = self.objectspace.space.variables[leader_fam_path]
|
|
||||||
else:
|
|
||||||
# it's a sub family
|
|
||||||
ori_leader_family = self.objectspace.paths.get_family(leader_fam_path,
|
|
||||||
leader.namespace,
|
|
||||||
)
|
|
||||||
has_a_leader = False
|
|
||||||
for variable in list(ori_leader_family.variable.values()):
|
|
||||||
if isinstance(variable, self.objectspace.leadership) and \
|
|
||||||
variable.variable[0].name == leader.name:
|
|
||||||
# append follower to an existed leadership
|
|
||||||
leader_space = variable
|
|
||||||
has_a_leader = True
|
|
||||||
elif variable.name == leader.name:
|
|
||||||
# it's a leader
|
# it's a leader
|
||||||
leader_space = self.manage_leader(variable,
|
|
||||||
group,
|
|
||||||
ori_leader_family,
|
|
||||||
)
|
|
||||||
has_a_leader = True
|
|
||||||
elif has_a_leader:
|
|
||||||
# it's should be a follower
|
|
||||||
self.manage_follower(follower_names.pop(0),
|
|
||||||
leader_fam_path,
|
|
||||||
variable,
|
|
||||||
leader_space,
|
|
||||||
)
|
|
||||||
# this variable is not more in ori_leader_family
|
|
||||||
ori_leader_family.variable.pop(normalize_family(variable.name))
|
|
||||||
if follower_names == []:
|
|
||||||
# no more follower
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
joined = '", "'.join(follower_names)
|
|
||||||
msg = _(f'when parsing leadership, we espect to find those followers "{joined}"')
|
|
||||||
raise DictConsistencyError(msg, 31, variable.xmlfiles)
|
|
||||||
del self.objectspace.space.constraints.group
|
|
||||||
|
|
||||||
def manage_leader(self,
|
|
||||||
variable: 'Variable',
|
|
||||||
group: 'Group',
|
|
||||||
ori_leader_family,
|
|
||||||
) -> 'Leadership':
|
|
||||||
"""manage leader's variable
|
|
||||||
"""
|
|
||||||
if variable.multi is not True:
|
if variable.multi is not True:
|
||||||
msg = _(f'the variable "{variable.name}" in a group must be multi')
|
msg = _(f'the variable "{variable.name}" in a leadership must be multi')
|
||||||
raise DictConsistencyError(msg, 32, variable.xmlfiles)
|
raise DictConsistencyError(msg, 32, variable.xmlfiles)
|
||||||
if hasattr(group, 'name'):
|
family.hidden = variable.hidden
|
||||||
ori_leadership_name = group.name
|
|
||||||
else:
|
|
||||||
ori_leadership_name = variable.name
|
|
||||||
leadership_name = normalize_family(ori_leadership_name)
|
|
||||||
leader_space = self.objectspace.leadership(variable.xmlfiles)
|
|
||||||
leader_space.variable = []
|
|
||||||
leader_space.name = leadership_name
|
|
||||||
leader_space.hidden = variable.hidden
|
|
||||||
if variable.hidden:
|
if variable.hidden:
|
||||||
variable.frozen = True
|
variable.frozen = True
|
||||||
variable.force_default_on_freeze = True
|
variable.force_default_on_freeze = True
|
||||||
variable.hidden = None
|
variable.hidden = None
|
||||||
if hasattr(group, 'description'):
|
|
||||||
leader_space.doc = group.description
|
|
||||||
elif variable.name == leadership_name and hasattr(variable, 'description'):
|
|
||||||
leader_space.doc = variable.description
|
|
||||||
else:
|
else:
|
||||||
leader_space.doc = ori_leadership_name
|
# it's a follower
|
||||||
leadership_path = ori_leader_family.path + '.' + leadership_name
|
if family.hidden:
|
||||||
self.objectspace.paths.add_leadership(variable.namespace,
|
|
||||||
leadership_path,
|
|
||||||
leader_space,
|
|
||||||
)
|
|
||||||
ori_leader_family.variable[normalize_family(variable.name)] = leader_space
|
|
||||||
leader_space.variable.append(variable)
|
|
||||||
self.objectspace.paths.set_leader(variable.namespace,
|
|
||||||
ori_leader_family.path,
|
|
||||||
leadership_name,
|
|
||||||
normalize_family(variable.name),
|
|
||||||
)
|
|
||||||
return leader_space
|
|
||||||
|
|
||||||
def manage_follower(self,
|
|
||||||
follower_name: str,
|
|
||||||
leader_family_name: str,
|
|
||||||
variable: 'Variable',
|
|
||||||
leader_space: 'Leadership',
|
|
||||||
) -> None:
|
|
||||||
"""manage follower
|
|
||||||
"""
|
|
||||||
if variable.name != follower_name:
|
|
||||||
msg = _('when parsing leadership, we expect to find the follower '
|
|
||||||
f'"{follower_name}" but we found "{variable.name}"')
|
|
||||||
raise DictConsistencyError(msg, 33, variable.xmlfiles)
|
|
||||||
self.objectspace.paths.set_leader(variable.namespace,
|
|
||||||
leader_family_name,
|
|
||||||
leader_space.name,
|
|
||||||
normalize_family(variable.name),
|
|
||||||
)
|
|
||||||
if leader_space.hidden:
|
|
||||||
variable.frozen = True
|
variable.frozen = True
|
||||||
variable.force_default_on_freeze = True
|
variable.force_default_on_freeze = True
|
||||||
leader_space.variable.append(variable)
|
if variable.multi is True:
|
||||||
|
variable.multi = 'submulti'
|
||||||
|
else:
|
||||||
|
variable.multi = True
|
||||||
|
@ -132,6 +132,7 @@ class ParamAnnotator:
|
|||||||
msg = _(f'parameter has incompatible type "{param.type}" '
|
msg = _(f'parameter has incompatible type "{param.type}" '
|
||||||
f'with type "{variable_type}"')
|
f'with type "{variable_type}"')
|
||||||
raise DictConsistencyError(msg, 7, param.xmlfiles)
|
raise DictConsistencyError(msg, 7, param.xmlfiles)
|
||||||
|
if variable_type != 'choice':
|
||||||
try:
|
try:
|
||||||
option = CONVERT_OPTION[variable_type]
|
option = CONVERT_OPTION[variable_type]
|
||||||
param.text = option.get('func', str)(param.text)
|
param.text = option.get('func', str)(param.text)
|
||||||
|
@ -106,8 +106,5 @@ class Annotator(Walk):
|
|||||||
def convert_variable(self) -> None:
|
def convert_variable(self) -> None:
|
||||||
"""convert variables
|
"""convert variables
|
||||||
"""
|
"""
|
||||||
for variable in self.get_variables(with_leadership=True):
|
for variable in self.get_variables():
|
||||||
if isinstance(variable, self.objectspace.leadership):
|
|
||||||
for follower in variable.variable:
|
|
||||||
self.convert_property(follower)
|
|
||||||
self.convert_property(variable)
|
self.convert_property(variable)
|
||||||
|
@ -28,15 +28,13 @@ from os.path import basename
|
|||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
|
||||||
from rougail.i18n import _
|
from rougail.i18n import _
|
||||||
from rougail.utils import normalize_family
|
from rougail.utils import normalize_family, valid_variable_family_name
|
||||||
from rougail.error import DictConsistencyError
|
from rougail.error import DictConsistencyError
|
||||||
# a object's attribute has some annotations
|
# a object's attribute has some annotations
|
||||||
# that shall not be present in the exported (flatened) XML
|
# that shall not be present in the exported (flatened) XML
|
||||||
ERASED_ATTRIBUTES = ('redefine', 'exists', 'optional', 'remove_check', 'namespace',
|
ERASED_ATTRIBUTES = ('redefine', 'namespace', 'xmlfiles', 'disabled', 'name', 'manage')
|
||||||
'remove_condition', 'path', 'instance_mode', 'index',
|
ERASED_ATTRIBUTES2 = ('redefine', 'namespace', 'xmlfiles')
|
||||||
'level', 'remove_fill', 'xmlfiles', 'type', 'reflector_name',
|
ALLOW_ATTRIBUT_NOT_MANAGE = ['file', 'engine', 'target']
|
||||||
'reflector_object',)
|
|
||||||
ALLOW_ATTRIBUT_NOT_MANAGE = ['file']
|
|
||||||
|
|
||||||
|
|
||||||
class Annotator:
|
class Annotator:
|
||||||
@ -72,14 +70,16 @@ class Annotator:
|
|||||||
self.objectspace.space.services.doc = 'services'
|
self.objectspace.space.services.doc = 'services'
|
||||||
self.objectspace.space.services.path = 'services'
|
self.objectspace.space.services.path = 'services'
|
||||||
for service_name, service in self.objectspace.space.services.service.items():
|
for service_name, service in self.objectspace.space.services.service.items():
|
||||||
|
valid_variable_family_name(service_name, service.xmlfiles)
|
||||||
activate_obj = self._generate_element('boolean',
|
activate_obj = self._generate_element('boolean',
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
'activate',
|
'activate',
|
||||||
True,
|
not service.disabled,
|
||||||
service,
|
service,
|
||||||
'.'.join(['services', normalize_family(service_name), 'activate']),
|
'.'.join(['services', normalize_family(service_name), 'activate']),
|
||||||
)
|
)
|
||||||
|
service.disabled = None
|
||||||
for elttype, values in dict(vars(service)).items():
|
for elttype, values in dict(vars(service)).items():
|
||||||
if elttype == 'servicelist':
|
if elttype == 'servicelist':
|
||||||
self.objectspace.list_conditions.setdefault('servicelist',
|
self.objectspace.list_conditions.setdefault('servicelist',
|
||||||
@ -87,11 +87,12 @@ class Annotator:
|
|||||||
values,
|
values,
|
||||||
[]).append(activate_obj)
|
[]).append(activate_obj)
|
||||||
continue
|
continue
|
||||||
if not isinstance(values, (dict, list)) or elttype in ERASED_ATTRIBUTES:
|
if elttype in ERASED_ATTRIBUTES:
|
||||||
continue
|
continue
|
||||||
if not service.manage and elttype not in ALLOW_ATTRIBUT_NOT_MANAGE:
|
if not service.manage and elttype not in ALLOW_ATTRIBUT_NOT_MANAGE:
|
||||||
msg = _(f'unmanage service cannot have "{elttype}"')
|
msg = _(f'unmanage service cannot have "{elttype}"')
|
||||||
raise DictConsistencyError(msg, 66, service.xmlfiles)
|
raise DictConsistencyError(msg, 66, service.xmlfiles)
|
||||||
|
if isinstance(values, (dict, list)):
|
||||||
if elttype != 'ip':
|
if elttype != 'ip':
|
||||||
eltname = elttype + 's'
|
eltname = elttype + 's'
|
||||||
else:
|
else:
|
||||||
@ -110,6 +111,10 @@ class Annotator:
|
|||||||
path,
|
path,
|
||||||
)
|
)
|
||||||
setattr(service, elttype, family)
|
setattr(service, elttype, family)
|
||||||
|
else:
|
||||||
|
if not hasattr(service, 'information'):
|
||||||
|
service.information = self.objectspace.information(service.xmlfiles)
|
||||||
|
setattr(service.information, elttype, values)
|
||||||
manage = self._generate_element('boolean',
|
manage = self._generate_element('boolean',
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
@ -156,7 +161,7 @@ class Annotator:
|
|||||||
'.'.join([subpath, 'activate']),
|
'.'.join([subpath, 'activate']),
|
||||||
)
|
)
|
||||||
for key in dir(elt):
|
for key in dir(elt):
|
||||||
if key.startswith('_') or key.endswith('_type') or key in ERASED_ATTRIBUTES:
|
if key.startswith('_') or key.endswith('_type') or key in ERASED_ATTRIBUTES2:
|
||||||
continue
|
continue
|
||||||
value = getattr(elt, key)
|
value = getattr(elt, key)
|
||||||
if key == listname:
|
if key == listname:
|
||||||
|
@ -41,24 +41,16 @@ class Annotator(Walk): # pylint: disable=R0903
|
|||||||
return
|
return
|
||||||
self.objectspace = objectspace
|
self.objectspace = objectspace
|
||||||
self.convert_value()
|
self.convert_value()
|
||||||
|
self.add_choice_nil()
|
||||||
|
|
||||||
def convert_value(self) -> None:
|
def convert_value(self) -> None:
|
||||||
"""convert value
|
"""convert value
|
||||||
"""
|
"""
|
||||||
for variable in self.get_variables(with_leadership=True):
|
for variable in self.get_variables():
|
||||||
if isinstance(variable, self.objectspace.leadership):
|
|
||||||
variable_type = 'leader'
|
|
||||||
for follower in variable.variable:
|
|
||||||
self._convert_value(follower,
|
|
||||||
variable_type,
|
|
||||||
)
|
|
||||||
variable_type = 'follower'
|
|
||||||
else:
|
|
||||||
self._convert_value(variable)
|
self._convert_value(variable)
|
||||||
|
|
||||||
def _convert_value(self,
|
def _convert_value(self,
|
||||||
variable,
|
variable,
|
||||||
variable_type: str=None,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
# a boolean must have value, the default value is "True"
|
# a boolean must have value, the default value is "True"
|
||||||
if not hasattr(variable, 'value') and variable.type == 'boolean':
|
if not hasattr(variable, 'value') and variable.type == 'boolean':
|
||||||
@ -82,19 +74,32 @@ class Annotator(Walk): # pylint: disable=R0903
|
|||||||
return
|
return
|
||||||
if variable.value[0].type == 'calculation':
|
if variable.value[0].type == 'calculation':
|
||||||
variable.default = variable.value[0]
|
variable.default = variable.value[0]
|
||||||
else:
|
elif variable.multi:
|
||||||
if variable.multi:
|
if not self.objectspace.paths.is_follower(variable.path):
|
||||||
if variable_type != 'follower':
|
|
||||||
variable.default = [value.name for value in variable.value]
|
variable.default = [value.name for value in variable.value]
|
||||||
if variable_type != 'leader':
|
if not self.objectspace.paths.is_leader(variable.path):
|
||||||
if variable.multi == 'submulti':
|
if variable.multi == 'submulti':
|
||||||
variable.default_multi = [value.name for value in variable.value]
|
variable.default_multi = [value.name for value in variable.value]
|
||||||
else:
|
else:
|
||||||
variable.default_multi = variable.value[0].name
|
variable.default_multi = variable.value[0].name
|
||||||
else:
|
else:
|
||||||
if len(variable.value) > 1:
|
if len(variable.value) > 1:
|
||||||
msg = _(f'the non multi variable "{variable.name}" cannot have '
|
msg = _(f'the none multi variable "{variable.name}" cannot have '
|
||||||
'more than one value')
|
'more than one value')
|
||||||
raise DictConsistencyError(msg, 68, variable.xmlfiles)
|
raise DictConsistencyError(msg, 68, variable.xmlfiles)
|
||||||
variable.default = variable.value[0].name
|
variable.default = variable.value[0].name
|
||||||
del variable.value
|
del variable.value
|
||||||
|
|
||||||
|
def add_choice_nil(self) -> None:
|
||||||
|
for variable in self.get_variables():
|
||||||
|
if variable.type != 'choice':
|
||||||
|
continue
|
||||||
|
is_none = False
|
||||||
|
for choice in variable.choice:
|
||||||
|
if choice.type == 'nil':
|
||||||
|
is_none = True
|
||||||
|
if not variable.mandatory and not is_none:
|
||||||
|
choice = self.objectspace.choice(variable.xmlfiles)
|
||||||
|
choice.name = None
|
||||||
|
choice.type = 'nil'
|
||||||
|
variable.choice.append(choice)
|
||||||
|
@ -62,37 +62,26 @@ CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FORCE_CHOICE = {'schedule': ['none', 'daily', 'weekly', 'monthly'],
|
|
||||||
'schedulemod': ['pre', 'post'],
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class Walk:
|
class Walk:
|
||||||
"""Walk to objectspace to find variable or family
|
"""Walk to objectspace to find variable or family
|
||||||
"""
|
"""
|
||||||
objectspace = None
|
objectspace = None
|
||||||
|
|
||||||
def get_variables(self,
|
def get_variables(self):
|
||||||
with_leadership: bool=False,
|
|
||||||
):
|
|
||||||
"""Iter all variables from the objectspace
|
"""Iter all variables from the objectspace
|
||||||
"""
|
"""
|
||||||
for family in self.objectspace.space.variables.values():
|
for family in self.objectspace.space.variables.values():
|
||||||
yield from self._get_variables(family, with_leadership)
|
yield from self._get_variables(family)
|
||||||
|
|
||||||
def _get_variables(self,
|
def _get_variables(self,
|
||||||
family: 'self.objectspace.family',
|
family: 'self.objectspace.family',
|
||||||
with_leadership: bool
|
|
||||||
):
|
):
|
||||||
if hasattr(family, 'variable'):
|
if not hasattr(family, 'variable'):
|
||||||
|
return
|
||||||
for variable in family.variable.values():
|
for variable in family.variable.values():
|
||||||
if isinstance(variable, self.objectspace.family):
|
if isinstance(variable, self.objectspace.family):
|
||||||
yield from self._get_variables(variable, with_leadership)
|
yield from self._get_variables(variable)
|
||||||
continue
|
else:
|
||||||
if not with_leadership and isinstance(variable, self.objectspace.leadership):
|
|
||||||
for follower in variable.variable:
|
|
||||||
yield follower
|
|
||||||
continue
|
|
||||||
yield variable
|
yield variable
|
||||||
|
|
||||||
def get_families(self):
|
def get_families(self):
|
||||||
@ -105,7 +94,8 @@ class Walk:
|
|||||||
family: 'self.objectspace.family',
|
family: 'self.objectspace.family',
|
||||||
):
|
):
|
||||||
yield family
|
yield family
|
||||||
if hasattr(family, 'variable'):
|
if not hasattr(family, 'variable'):
|
||||||
|
return
|
||||||
for fam in family.variable.values():
|
for fam in family.variable.values():
|
||||||
if isinstance(fam, self.objectspace.family):
|
if isinstance(fam, self.objectspace.family):
|
||||||
yield from self._get_families(fam)
|
yield from self._get_families(fam)
|
||||||
@ -132,23 +122,11 @@ class Annotator(Walk): # pylint: disable=R0903
|
|||||||
def convert_variable(self):
|
def convert_variable(self):
|
||||||
"""convert variable
|
"""convert variable
|
||||||
"""
|
"""
|
||||||
for variable in self.get_variables(with_leadership=True):
|
for variable in self.get_variables():
|
||||||
if isinstance(variable, self.objectspace.leadership):
|
self._convert_variable(variable)
|
||||||
# first variable is a leader, others are follower
|
|
||||||
variable_type = 'leader'
|
|
||||||
for follower in variable.variable:
|
|
||||||
self._convert_variable(follower,
|
|
||||||
variable_type,
|
|
||||||
)
|
|
||||||
variable_type = 'follower'
|
|
||||||
else:
|
|
||||||
self._convert_variable(variable,
|
|
||||||
'variable',
|
|
||||||
)
|
|
||||||
|
|
||||||
def _convert_variable(self,
|
def _convert_variable(self,
|
||||||
variable,
|
variable,
|
||||||
variable_type: str,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
if variable.namespace == self.objectspace.rougailconfig['variable_namespace'] and \
|
if variable.namespace == self.objectspace.rougailconfig['variable_namespace'] and \
|
||||||
variable.name in self.forbidden_name:
|
variable.name in self.forbidden_name:
|
||||||
@ -171,61 +149,67 @@ class Annotator(Walk): # pylint: disable=R0903
|
|||||||
del variable.value[idx]
|
del variable.value[idx]
|
||||||
if not variable.value:
|
if not variable.value:
|
||||||
del variable.value
|
del variable.value
|
||||||
|
if hasattr(variable, 'choice'):
|
||||||
|
if variable.type != 'choice':
|
||||||
|
msg = _(f'choice for the variable "{variable.name}" not allowed with "{variable.type}" type')
|
||||||
|
raise DictConsistencyError(msg, 3, variable.xmlfiles)
|
||||||
|
values = []
|
||||||
|
choice_type = None
|
||||||
|
for choice in variable.choice:
|
||||||
|
if choice_type == 'variable':
|
||||||
|
msg = _(f'only one "variable" choice is allowed '
|
||||||
|
f'the variable "{variable.name}"')
|
||||||
|
raise DictConsistencyError(msg, 5, choice.xmlfiles)
|
||||||
|
if choice.type == 'nil':
|
||||||
|
choice.name = None
|
||||||
|
elif choice.type == 'variable':
|
||||||
|
choice.name = self.objectspace.paths.get_variable(choice.name)
|
||||||
|
if not choice.name.multi:
|
||||||
|
msg = _(f'only multi "variable" is allowed for a choice '
|
||||||
|
f'of variable "{variable.name}"')
|
||||||
|
raise DictConsistencyError(msg, 6, choice.xmlfiles)
|
||||||
|
else:
|
||||||
|
if not hasattr(choice, 'name'):
|
||||||
|
msg = _(f'choice for variable "{variable.name}" must have a value')
|
||||||
|
raise DictConsistencyError(msg, 14, choice.xmlfiles)
|
||||||
|
choice.name = CONVERT_OPTION.get(choice.type, {}).get('func', str)(choice.name)
|
||||||
|
if choice_type is None:
|
||||||
|
choice_type = choice.type
|
||||||
|
values.append(choice.name)
|
||||||
|
if choice_type not in ['function', 'variable'] and hasattr(variable, 'value'):
|
||||||
|
for value in variable.value:
|
||||||
|
if value.name not in values:
|
||||||
|
msg = _(f'value "{value.name}" of variable "{variable.name}" is not in list '
|
||||||
|
f'of all expected values ({values})')
|
||||||
|
raise DictConsistencyError(msg, 15, value.xmlfiles)
|
||||||
|
ref_choice = variable.choice[0]
|
||||||
|
self.objectspace.valid_enums[variable.path] = {'type': ref_choice.type,
|
||||||
|
'values': values,
|
||||||
|
'xmlfiles': ref_choice.xmlfiles,
|
||||||
|
}
|
||||||
|
elif variable.type == 'choice':
|
||||||
|
msg = _(f'choice is mandatory for the variable "{variable.name}" with choice type')
|
||||||
|
raise DictConsistencyError(msg, 4, variable.xmlfiles)
|
||||||
variable.doc = variable.description
|
variable.doc = variable.description
|
||||||
del variable.description
|
del variable.description
|
||||||
if variable_type == 'follower':
|
|
||||||
if variable.multi is True:
|
|
||||||
variable.multi = 'submulti'
|
|
||||||
else:
|
|
||||||
variable.multi = True
|
|
||||||
self._convert_valid_enum(variable)
|
|
||||||
|
|
||||||
def _convert_valid_enum(self,
|
|
||||||
variable,
|
|
||||||
):
|
|
||||||
"""some types are, in fact, choices
|
|
||||||
convert this kind of variables into choice
|
|
||||||
"""
|
|
||||||
if variable.type in FORCE_CHOICE:
|
|
||||||
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
|
|
||||||
if not hasattr(self.objectspace.space.constraints, 'check'):
|
|
||||||
self.objectspace.space.constraints.check = []
|
|
||||||
check = self.objectspace.check(variable.xmlfiles)
|
|
||||||
check.name = 'valid_enum'
|
|
||||||
target = self.objectspace.target(variable.xmlfiles)
|
|
||||||
target.name = variable.path
|
|
||||||
check.target = [target]
|
|
||||||
check.namespace = variable.namespace
|
|
||||||
check.param = []
|
|
||||||
for value in FORCE_CHOICE[variable.type]:
|
|
||||||
param = self.objectspace.param(variable.xmlfiles)
|
|
||||||
param.text = value
|
|
||||||
check.param.append(param)
|
|
||||||
self.objectspace.space.constraints.check.append(check)
|
|
||||||
variable.type = 'string'
|
|
||||||
|
|
||||||
def convert_test(self):
|
def convert_test(self):
|
||||||
"""Convert variable tests value
|
"""Convert variable tests value
|
||||||
"""
|
"""
|
||||||
for variable in self.get_variables():
|
for variable in self.get_variables():
|
||||||
if not hasattr(variable, 'test'):
|
if not hasattr(variable, 'test') or not variable.test:
|
||||||
|
# with we want remove test, we set "" has test value
|
||||||
continue
|
continue
|
||||||
if variable.test:
|
|
||||||
if not hasattr(variable, 'information'):
|
|
||||||
variable.information = self.objectspace.information(variable.xmlfiles)
|
|
||||||
values = variable.test.split('|')
|
|
||||||
new_values = []
|
new_values = []
|
||||||
for value in values:
|
for value in variable.test.split('|'):
|
||||||
if value == '':
|
if value == '':
|
||||||
value = None
|
value = None
|
||||||
else:
|
else:
|
||||||
value = CONVERT_OPTION.get(variable.type, {}).get('func', str)(value)
|
value = CONVERT_OPTION.get(variable.type, {}).get('func', str)(value)
|
||||||
new_values.append(value)
|
new_values.append(value)
|
||||||
|
if not hasattr(variable, 'information'):
|
||||||
|
variable.information = self.objectspace.information(variable.xmlfiles)
|
||||||
variable.information.test = tuple(new_values)
|
variable.information.test = tuple(new_values)
|
||||||
del variable.test
|
|
||||||
|
|
||||||
def convert_help(self):
|
def convert_help(self):
|
||||||
"""Convert variable help
|
"""Convert variable help
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
<!-- =============== -->
|
<!-- =============== -->
|
||||||
|
|
||||||
<!ELEMENT rougail (services|variables|constraints)*>
|
<!ELEMENT rougail (services|variables|constraints)*>
|
||||||
<!ATTLIST rougail version (0.9) #REQUIRED>
|
<!ATTLIST rougail version (0.10) #REQUIRED>
|
||||||
|
|
||||||
<!-- ============== -->
|
<!-- ============== -->
|
||||||
<!-- files element -->
|
<!-- files element -->
|
||||||
@ -50,6 +50,10 @@
|
|||||||
<!ATTLIST service name CDATA #REQUIRED>
|
<!ATTLIST service name CDATA #REQUIRED>
|
||||||
<!ATTLIST service manage (True|False) "True">
|
<!ATTLIST service manage (True|False) "True">
|
||||||
<!ATTLIST service servicelist CDATA #IMPLIED>
|
<!ATTLIST service servicelist CDATA #IMPLIED>
|
||||||
|
<!ATTLIST service disabled (True|False) "False">
|
||||||
|
<!ATTLIST service engine (none|creole|jinja2) #IMPLIED>
|
||||||
|
<!ATTLIST service target CDATA #IMPLIED>
|
||||||
|
<!ATTLIST service type (service|mount) "service">
|
||||||
|
|
||||||
<!ELEMENT ip (#PCDATA)>
|
<!ELEMENT ip (#PCDATA)>
|
||||||
<!ATTLIST ip iplist CDATA #IMPLIED>
|
<!ATTLIST ip iplist CDATA #IMPLIED>
|
||||||
@ -83,11 +87,12 @@
|
|||||||
<!ATTLIST family mode CDATA #IMPLIED>
|
<!ATTLIST family mode CDATA #IMPLIED>
|
||||||
<!ATTLIST family hidden (True|False) "False">
|
<!ATTLIST family hidden (True|False) "False">
|
||||||
<!ATTLIST family dynamic CDATA #IMPLIED>
|
<!ATTLIST family dynamic CDATA #IMPLIED>
|
||||||
|
<!ATTLIST family leadership (True|False) "False">
|
||||||
<!ATTLIST family provider CDATA #IMPLIED>
|
<!ATTLIST family provider CDATA #IMPLIED>
|
||||||
|
|
||||||
<!ELEMENT variable (value*)>
|
<!ELEMENT variable ((choice*|value*)*)>
|
||||||
<!ATTLIST variable name CDATA #REQUIRED>
|
<!ATTLIST variable name CDATA #REQUIRED>
|
||||||
<!ATTLIST variable type (number|float|string|password|mail|boolean|filename|date|unix_user|ip|local_ip|netmask|network|broadcast|netbios|domainname|hostname|web_address|port|mac|cidr|network_cidr|schedule|schedulemod) "string">
|
<!ATTLIST variable type (number|float|string|password|mail|boolean|filename|date|unix_user|ip|local_ip|netmask|network|broadcast|netbios|domainname|hostname|web_address|port|mac|cidr|network_cidr|choice) "string">
|
||||||
<!ATTLIST variable description CDATA #IMPLIED>
|
<!ATTLIST variable description CDATA #IMPLIED>
|
||||||
<!ATTLIST variable help CDATA #IMPLIED>
|
<!ATTLIST variable help CDATA #IMPLIED>
|
||||||
<!ATTLIST variable hidden (True|False) "False">
|
<!ATTLIST variable hidden (True|False) "False">
|
||||||
@ -99,6 +104,7 @@
|
|||||||
<!ATTLIST variable auto_freeze (True|False) "False">
|
<!ATTLIST variable auto_freeze (True|False) "False">
|
||||||
<!ATTLIST variable auto_save (True|False) "False">
|
<!ATTLIST variable auto_save (True|False) "False">
|
||||||
<!ATTLIST variable mode CDATA #IMPLIED>
|
<!ATTLIST variable mode CDATA #IMPLIED>
|
||||||
|
<!ATTLIST variable remove_choice (True|False) "False">
|
||||||
<!ATTLIST variable remove_check (True|False) "False">
|
<!ATTLIST variable remove_check (True|False) "False">
|
||||||
<!ATTLIST variable remove_condition (True|False) "False">
|
<!ATTLIST variable remove_condition (True|False) "False">
|
||||||
<!ATTLIST variable remove_fill (True|False) "False">
|
<!ATTLIST variable remove_fill (True|False) "False">
|
||||||
@ -106,8 +112,13 @@
|
|||||||
<!ATTLIST variable test CDATA #IMPLIED>
|
<!ATTLIST variable test CDATA #IMPLIED>
|
||||||
|
|
||||||
<!ELEMENT value (#PCDATA)>
|
<!ELEMENT value (#PCDATA)>
|
||||||
|
<!ATTLIST value type (string|number|nil|boolean) #IMPLIED>
|
||||||
|
|
||||||
<!ELEMENT constraints ((fill*|check*|condition*|group*)*)>
|
<!ELEMENT choice (#PCDATA | param)*>
|
||||||
|
<!ATTLIST choice type (string|number|nil|boolean|function|variable) "string">
|
||||||
|
<!ATTLIST choice name CDATA #IMPLIED>
|
||||||
|
|
||||||
|
<!ELEMENT constraints ((fill*|check*|condition*)*)>
|
||||||
|
|
||||||
<!ELEMENT fill ((target|param)+)>
|
<!ELEMENT fill ((target|param)+)>
|
||||||
<!ATTLIST fill name CDATA #REQUIRED>
|
<!ATTLIST fill name CDATA #REQUIRED>
|
||||||
@ -131,10 +142,3 @@
|
|||||||
<!ELEMENT target (#PCDATA)>
|
<!ELEMENT target (#PCDATA)>
|
||||||
<!ATTLIST target type (variable|family|servicelist|filelist|iplist) "variable">
|
<!ATTLIST target type (variable|family|servicelist|filelist|iplist) "variable">
|
||||||
<!ATTLIST target optional (True|False) "False">
|
<!ATTLIST target optional (True|False) "False">
|
||||||
|
|
||||||
<!ELEMENT group (follower+)>
|
|
||||||
<!ATTLIST group leader CDATA #REQUIRED>
|
|
||||||
<!ATTLIST group name CDATA #IMPLIED>
|
|
||||||
<!ATTLIST group description CDATA #IMPLIED>
|
|
||||||
|
|
||||||
<!ELEMENT follower (#PCDATA)>
|
|
||||||
|
@ -38,9 +38,9 @@ FORCE_REDEFINABLES = ('family', 'follower', 'service', 'disknod', 'variables')
|
|||||||
# RougailObjSpace's elements that shall be forced to the UnRedefinable type
|
# RougailObjSpace's elements that shall be forced to the UnRedefinable type
|
||||||
FORCE_UNREDEFINABLES = ('value',)
|
FORCE_UNREDEFINABLES = ('value',)
|
||||||
# RougailObjSpace's elements that shall not be modify
|
# RougailObjSpace's elements that shall not be modify
|
||||||
UNREDEFINABLE = ('multi', 'type')
|
UNREDEFINABLE = ('multi', 'type',)
|
||||||
# RougailObjSpace's elements that did not created automaticly
|
# RougailObjSpace's elements that did not created automaticly
|
||||||
FORCE_ELEMENTS = ('choice', 'property_', 'leadership', 'information')
|
FORCE_ELEMENTS = ('property_', 'information')
|
||||||
# XML text are convert has name
|
# XML text are convert has name
|
||||||
FORCED_TEXT_ELTS_AS_NAME = ('choice', 'property', 'value',)
|
FORCED_TEXT_ELTS_AS_NAME = ('choice', 'property', 'value',)
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ class RougailObjSpace:
|
|||||||
for attr, val in child.attrib.items():
|
for attr, val in child.attrib.items():
|
||||||
if redefine and attr in UNREDEFINABLE:
|
if redefine and attr in UNREDEFINABLE:
|
||||||
msg = _(f'cannot redefine attribute "{attr}" for variable "{child.attrib["name"]}"'
|
msg = _(f'cannot redefine attribute "{attr}" for variable "{child.attrib["name"]}"'
|
||||||
f' in "{xmlfile}", already defined')
|
f' already defined')
|
||||||
raise DictConsistencyError(msg, 48, variableobj.xmlfiles[:-1])
|
raise DictConsistencyError(msg, 48, variableobj.xmlfiles[:-1])
|
||||||
if attr in self.booleans_attributs:
|
if attr in self.booleans_attributs:
|
||||||
val = convert_boolean(val)
|
val = convert_boolean(val)
|
||||||
@ -410,6 +410,12 @@ class RougailObjSpace:
|
|||||||
"""Rougail object tree manipulations
|
"""Rougail object tree manipulations
|
||||||
"""
|
"""
|
||||||
if child.tag == 'variable':
|
if child.tag == 'variable':
|
||||||
|
if child.attrib.get('remove_choice', False):
|
||||||
|
if variableobj.type != 'choice':
|
||||||
|
msg = _(f'cannot remove choices for variable "{variableobj.path}"'
|
||||||
|
f' the variable has type "{variableobj.type}"')
|
||||||
|
raise DictConsistencyError(msg, 33, variableobj.xmlfiles)
|
||||||
|
variableobj.choice = []
|
||||||
if child.attrib.get('remove_check', False):
|
if child.attrib.get('remove_check', False):
|
||||||
self.remove_check(variableobj.name)
|
self.remove_check(variableobj.name)
|
||||||
if child.attrib.get('remove_condition', False):
|
if child.attrib.get('remove_condition', False):
|
||||||
@ -424,6 +430,7 @@ class RougailObjSpace:
|
|||||||
def remove_check(self, name):
|
def remove_check(self, name):
|
||||||
"""Remove a check with a specified target
|
"""Remove a check with a specified target
|
||||||
"""
|
"""
|
||||||
|
if hasattr(self.space.constraints, 'check'):
|
||||||
remove_checks = []
|
remove_checks = []
|
||||||
for idx, check in enumerate(self.space.constraints.check): # pylint: disable=E1101
|
for idx, check in enumerate(self.space.constraints.check): # pylint: disable=E1101
|
||||||
for target in check.target:
|
for target in check.target:
|
||||||
@ -474,16 +481,21 @@ class RougailObjSpace:
|
|||||||
else:
|
else:
|
||||||
family_name = namespace
|
family_name = namespace
|
||||||
|
|
||||||
|
if isinstance(space, self.family) and space.leadership:
|
||||||
|
leader = space.path
|
||||||
|
else:
|
||||||
|
leader = None
|
||||||
self.paths.add_variable(namespace,
|
self.paths.add_variable(namespace,
|
||||||
variableobj.name,
|
variableobj.name,
|
||||||
space.path,
|
space.path,
|
||||||
document.attrib.get('dynamic') is not None,
|
document.attrib.get('dynamic') is not None,
|
||||||
variableobj,
|
variableobj,
|
||||||
|
leader,
|
||||||
)
|
)
|
||||||
elif isinstance(variableobj, self.family): # pylint: disable=E1101
|
elif isinstance(variableobj, self.family): # pylint: disable=E1101
|
||||||
family_name = variableobj.name
|
family_name = variableobj.name
|
||||||
if namespace != self.rougailconfig['variable_namespace']:
|
if namespace != self.rougailconfig['variable_namespace']:
|
||||||
family_name = namespace + '.' + family_name
|
family_name = space.path + '.' + family_name
|
||||||
self.paths.add_family(namespace,
|
self.paths.add_family(namespace,
|
||||||
family_name,
|
family_name,
|
||||||
variableobj,
|
variableobj,
|
||||||
|
@ -77,19 +77,6 @@ class Path:
|
|||||||
)
|
)
|
||||||
variableobj.path = full_name
|
variableobj.path = full_name
|
||||||
|
|
||||||
def add_leadership(self,
|
|
||||||
namespace: str,
|
|
||||||
path: str,
|
|
||||||
variableobj: str,
|
|
||||||
) -> str: # pylint: disable=C0111
|
|
||||||
"""add a new leadership
|
|
||||||
"""
|
|
||||||
self.families[path] = dict(name=path,
|
|
||||||
namespace=namespace,
|
|
||||||
variableobj=variableobj,
|
|
||||||
)
|
|
||||||
variableobj.path = path
|
|
||||||
|
|
||||||
def get_family(self,
|
def get_family(self,
|
||||||
name: str,
|
name: str,
|
||||||
current_namespace: str,
|
current_namespace: str,
|
||||||
@ -109,26 +96,6 @@ class Path:
|
|||||||
raise DictConsistencyError(msg, 38, [])
|
raise DictConsistencyError(msg, 38, [])
|
||||||
return dico['variableobj']
|
return dico['variableobj']
|
||||||
|
|
||||||
# Leadership
|
|
||||||
def set_leader(self,
|
|
||||||
namespace: str,
|
|
||||||
leader_family_name: str,
|
|
||||||
leadership_name: str,
|
|
||||||
name: str,
|
|
||||||
) -> None: # pylint: disable=C0111
|
|
||||||
"""set a variable a leadership member
|
|
||||||
"""
|
|
||||||
# need rebuild path and move object in new path
|
|
||||||
old_path = leader_family_name + '.' + name
|
|
||||||
leadership_path = leader_family_name + '.' + leadership_name
|
|
||||||
new_path = leadership_path + '.' + name
|
|
||||||
self.variables[new_path] = self.variables.pop(old_path)
|
|
||||||
self.variables[new_path]['leader'] = leadership_path
|
|
||||||
self.variables[new_path]['variableobj'].path = new_path
|
|
||||||
self.variables[new_path]['family'] = leadership_path
|
|
||||||
if namespace == self.variable_namespace:
|
|
||||||
self.full_paths_variables[name] = new_path
|
|
||||||
|
|
||||||
def is_leader(self, path): # pylint: disable=C0111
|
def is_leader(self, path): # pylint: disable=C0111
|
||||||
"""Is the variable is a leader
|
"""Is the variable is a leader
|
||||||
"""
|
"""
|
||||||
@ -136,7 +103,7 @@ class Path:
|
|||||||
if not variable['leader']:
|
if not variable['leader']:
|
||||||
return False
|
return False
|
||||||
leadership = self.get_family(variable['leader'], variable['variableobj'].namespace)
|
leadership = self.get_family(variable['leader'], variable['variableobj'].namespace)
|
||||||
return leadership.variable[0].path == path
|
return next(iter(leadership.variable.values())).path == path
|
||||||
|
|
||||||
def is_follower(self, path):
|
def is_follower(self, path):
|
||||||
"""Is the variable is a follower
|
"""Is the variable is a follower
|
||||||
@ -145,7 +112,7 @@ class Path:
|
|||||||
if not variable['leader']:
|
if not variable['leader']:
|
||||||
return False
|
return False
|
||||||
leadership = self.get_family(variable['leader'], variable['variableobj'].namespace)
|
leadership = self.get_family(variable['leader'], variable['variableobj'].namespace)
|
||||||
return leadership.variable[0].path != path
|
return next(iter(leadership.variable.values())).path != path
|
||||||
|
|
||||||
# Variable
|
# Variable
|
||||||
def add_variable(self, # pylint: disable=R0913
|
def add_variable(self, # pylint: disable=R0913
|
||||||
@ -154,6 +121,7 @@ class Path:
|
|||||||
family: str,
|
family: str,
|
||||||
is_dynamic: bool,
|
is_dynamic: bool,
|
||||||
variableobj,
|
variableobj,
|
||||||
|
leader: 'self.objectspace.family'=None,
|
||||||
) -> str: # pylint: disable=C0111
|
) -> str: # pylint: disable=C0111
|
||||||
"""Add a new variable (with path)
|
"""Add a new variable (with path)
|
||||||
"""
|
"""
|
||||||
@ -169,7 +137,7 @@ class Path:
|
|||||||
raise DictConsistencyError(msg, 57, variableobj.xmlfiles)
|
raise DictConsistencyError(msg, 57, variableobj.xmlfiles)
|
||||||
self.variables[full_path] = dict(name=name,
|
self.variables[full_path] = dict(name=name,
|
||||||
family=family,
|
family=family,
|
||||||
leader=None,
|
leader=leader,
|
||||||
is_dynamic=is_dynamic,
|
is_dynamic=is_dynamic,
|
||||||
variableobj=variableobj,
|
variableobj=variableobj,
|
||||||
)
|
)
|
||||||
|
@ -255,6 +255,7 @@ class RougailBaseTemplate:
|
|||||||
filevar: Dict,
|
filevar: Dict,
|
||||||
type_: str,
|
type_: str,
|
||||||
service_name: str,
|
service_name: str,
|
||||||
|
service_type: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Run templatisation on one file
|
"""Run templatisation on one file
|
||||||
"""
|
"""
|
||||||
@ -275,10 +276,11 @@ class RougailBaseTemplate:
|
|||||||
var = variable[idx]
|
var = variable[idx]
|
||||||
else:
|
else:
|
||||||
var = None
|
var = None
|
||||||
func = f'_instance_{type_}'
|
func = f'get_data_{type_}'
|
||||||
data = getattr(self, func)(filevar,
|
data = getattr(self, func)(filevar,
|
||||||
filename,
|
filename,
|
||||||
service_name,
|
service_name,
|
||||||
|
service_type,
|
||||||
variable,
|
variable,
|
||||||
idx,
|
idx,
|
||||||
)
|
)
|
||||||
@ -319,10 +321,26 @@ class RougailBaseTemplate:
|
|||||||
for included in (True, False):
|
for included in (True, False):
|
||||||
for service_obj in await self.config.option('services').list('all'):
|
for service_obj in await self.config.option('services').list('all'):
|
||||||
service_name = await service_obj.option.name()
|
service_name = await service_obj.option.name()
|
||||||
|
service_type = await service_obj.information.get('type', 'service')
|
||||||
if await service_obj.option('activate').value.get() is False:
|
if await service_obj.option('activate').value.get() is False:
|
||||||
if included is False:
|
if included is False:
|
||||||
self.desactive_service(service_name)
|
self.desactive_service(service_name, service_type)
|
||||||
continue
|
continue
|
||||||
|
if not included:
|
||||||
|
engine = await service_obj.information.get('engine', None)
|
||||||
|
if engine:
|
||||||
|
self.instance_file({'engine': engine},
|
||||||
|
'service',
|
||||||
|
service_name,
|
||||||
|
service_type,
|
||||||
|
)
|
||||||
|
target_name = await service_obj.information.get('target', None)
|
||||||
|
if target_name:
|
||||||
|
self.target_service(service_name,
|
||||||
|
target_name,
|
||||||
|
service_type,
|
||||||
|
engine is None,
|
||||||
|
)
|
||||||
for fills in await service_obj.list('optiondescription'):
|
for fills in await service_obj.list('optiondescription'):
|
||||||
type_ = await fills.option.name()
|
type_ = await fills.option.name()
|
||||||
for fill_obj in await fills.list('all'):
|
for fill_obj in await fills.list('all'):
|
||||||
@ -335,10 +353,14 @@ class RougailBaseTemplate:
|
|||||||
elif included is True:
|
elif included is True:
|
||||||
continue
|
continue
|
||||||
if fill['activate']:
|
if fill['activate']:
|
||||||
self.instance_file(fill, type_, service_name)
|
self.instance_file(fill,
|
||||||
|
type_,
|
||||||
|
service_name,
|
||||||
|
service_type,
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
self.log.debug(_("Instantiation of file '{filename}' disabled"))
|
self.log.debug(_("Instantiation of file '{filename}' disabled"))
|
||||||
self.post_instance_service(service_name)
|
self.post_instance_service(service_name, service_type)
|
||||||
self.post_instance()
|
self.post_instance()
|
||||||
chdir(ori_dir)
|
chdir(ori_dir)
|
||||||
|
|
||||||
@ -356,27 +378,40 @@ class RougailBaseTemplate:
|
|||||||
dico[key] = await obj.information.get(key, default_value)
|
dico[key] = await obj.information.get(key, default_value)
|
||||||
|
|
||||||
def desactive_service(self,
|
def desactive_service(self,
|
||||||
service_name: str,
|
*args,
|
||||||
):
|
):
|
||||||
raise NotImplementedError(_('cannot desactivate a service'))
|
raise NotImplementedError(_('cannot desactivate a service'))
|
||||||
|
|
||||||
def post_instance_service(self, service_name): # pragma: no cover
|
def target_service(self,
|
||||||
|
service_name: str,
|
||||||
|
*args,
|
||||||
|
):
|
||||||
|
raise NotImplementedError(_('cannot use target for the service {service_name}'))
|
||||||
|
|
||||||
|
def post_instance_service(self,
|
||||||
|
*args,
|
||||||
|
): # pragma: no cover
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def post_instance(self): # pragma: no cover
|
def post_instance(self): # pragma: no cover
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _instance_ip(self,
|
def get_data_ip(self,
|
||||||
*args,
|
*args,
|
||||||
) -> None: # pragma: no cover
|
) -> None: # pragma: no cover
|
||||||
raise NotImplementedError(_('cannot instanciate this service type ip'))
|
raise NotImplementedError(_('cannot instanciate this service type ip'))
|
||||||
|
|
||||||
def _instance_files(self,
|
def get_data_files(self,
|
||||||
*args,
|
*args,
|
||||||
) -> None: # pragma: no cover
|
) -> None: # pragma: no cover
|
||||||
raise NotImplementedError(_('cannot instanciate this service type file'))
|
raise NotImplementedError(_('cannot instanciate this service type file'))
|
||||||
|
|
||||||
def _instance_overrides(self,
|
def get_data_service(self,
|
||||||
|
*args,
|
||||||
|
) -> None: # pragma: no cover
|
||||||
|
raise NotImplementedError(_('cannot instanciate this service'))
|
||||||
|
|
||||||
|
def get_data_overrides(self,
|
||||||
*args,
|
*args,
|
||||||
) -> None: # pragma: no cover
|
) -> None: # pragma: no cover
|
||||||
raise NotImplementedError(_('cannot instanciate this service type override'))
|
raise NotImplementedError(_('cannot instanciate this service type override'))
|
||||||
|
@ -38,9 +38,13 @@ IPAddressDeny=any
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
ROUGAIL_TMPL_TEMPLATE = """%def display(%%file, %%filename)
|
ROUGAIL_DEST = '/usr/local/lib'
|
||||||
|
ROUGAIL_GLOBAL_SYSTEMD_FILE = '/usr/lib/systemd/system'
|
||||||
|
|
||||||
|
|
||||||
|
ROUGAIL_TMPL_TEMPLATE = f"""%def display(%%file, %%filename)
|
||||||
%if %%filename.startswith('/etc/') or %%filename.startswith('/var/') or %%filename.startswith('/srv/')
|
%if %%filename.startswith('/etc/') or %%filename.startswith('/var/') or %%filename.startswith('/srv/')
|
||||||
C %%filename %%file.mode %%file.owner %%file.group - /usr/local/lib%%filename
|
C %%filename %%file.mode %%file.owner %%file.group - {ROUGAIL_DEST}%%filename
|
||||||
z %%filename - - - - -
|
z %%filename - - - - -
|
||||||
%end if
|
%end if
|
||||||
%end def
|
%end def
|
||||||
@ -70,10 +74,11 @@ class RougailSystemdTemplate(RougailBaseTemplate):
|
|||||||
self.ip_per_service = None
|
self.ip_per_service = None
|
||||||
super().__init__(config, rougailconfig)
|
super().__init__(config, rougailconfig)
|
||||||
|
|
||||||
def _instance_files(self,
|
def get_data_files(self,
|
||||||
filevar: Dict,
|
filevar: Dict,
|
||||||
destfile: str,
|
destfile: str,
|
||||||
service_name: str,
|
service_name: str,
|
||||||
|
service_type: str,
|
||||||
variable,
|
variable,
|
||||||
idx: int,
|
idx: int,
|
||||||
) -> tuple:
|
) -> tuple:
|
||||||
@ -88,10 +93,11 @@ class RougailSystemdTemplate(RougailBaseTemplate):
|
|||||||
var = None
|
var = None
|
||||||
return tmp_file, None, destfile, var
|
return tmp_file, None, destfile, var
|
||||||
|
|
||||||
def _instance_overrides(self,
|
def get_data_overrides(self,
|
||||||
filevar: Dict,
|
filevar: Dict,
|
||||||
destfile,
|
destfile,
|
||||||
service_name: str,
|
service_name: str,
|
||||||
|
service_type: str,
|
||||||
*args,
|
*args,
|
||||||
) -> tuple:
|
) -> tuple:
|
||||||
source = filevar['source']
|
source = filevar['source']
|
||||||
@ -99,12 +105,14 @@ class RougailSystemdTemplate(RougailBaseTemplate):
|
|||||||
raise FileNotFound(_(f"File {source} does not exist."))
|
raise FileNotFound(_(f"File {source} does not exist."))
|
||||||
tmp_file = join(self.tmp_dir, source)
|
tmp_file = join(self.tmp_dir, source)
|
||||||
service_name = filevar['name']
|
service_name = filevar['name']
|
||||||
return tmp_file, None, f'/systemd/system/{service_name}.service.d/rougail.conf', None
|
destfile = f'/systemd/system/{service_name}.{service_type}.d/rougail.conf'
|
||||||
|
return tmp_file, None, destfile, None
|
||||||
|
|
||||||
def _instance_ip(self,
|
def get_data_ip(self,
|
||||||
filevar: Dict,
|
filevar: Dict,
|
||||||
ip,
|
ip,
|
||||||
service_name: str,
|
service_name: str,
|
||||||
|
service_type: str,
|
||||||
var: Any,
|
var: Any,
|
||||||
idx: int,
|
idx: int,
|
||||||
*args,
|
*args,
|
||||||
@ -120,19 +128,49 @@ class RougailSystemdTemplate(RougailBaseTemplate):
|
|||||||
elif ip:
|
elif ip:
|
||||||
self.ip_per_service.append(ip)
|
self.ip_per_service.append(ip)
|
||||||
|
|
||||||
|
def get_data_service(self,
|
||||||
|
servicevar: Dict,
|
||||||
|
info,
|
||||||
|
service_name: str,
|
||||||
|
service_type: str,
|
||||||
|
*args,
|
||||||
|
):
|
||||||
|
filename = f'{service_name}.{service_type}'
|
||||||
|
tmp_file = join(self.tmp_dir, filename)
|
||||||
|
var = None
|
||||||
|
destfile = f'/systemd/system/{filename}'
|
||||||
|
return tmp_file, None, destfile, var
|
||||||
|
|
||||||
|
|
||||||
def desactive_service(self,
|
def desactive_service(self,
|
||||||
service_name: str,
|
service_name: str,
|
||||||
|
service_type: str,
|
||||||
):
|
):
|
||||||
filename = f'{self.destinations_dir}/systemd/system/{service_name}.service'
|
filename = f'{self.destinations_dir}/systemd/system/{service_name}.{service_type}'
|
||||||
makedirs(dirname(filename), exist_ok=True)
|
makedirs(dirname(filename), exist_ok=True)
|
||||||
symlink('/dev/null', filename)
|
symlink('/dev/null', filename)
|
||||||
|
|
||||||
|
def target_service(self,
|
||||||
|
service_name: str,
|
||||||
|
target_name: str,
|
||||||
|
service_type: str,
|
||||||
|
global_service: str,
|
||||||
|
):
|
||||||
|
filename = f'{self.destinations_dir}/systemd/system/{target_name}.target.wants/{service_name}.{service_type}'
|
||||||
|
makedirs(dirname(filename), exist_ok=True)
|
||||||
|
if global_service:
|
||||||
|
source_filename = f'{ROUGAIL_GLOBAL_SYSTEMD_FILE}/{service_name}.{service_type}'
|
||||||
|
else:
|
||||||
|
source_filename = f'{ROUGAIL_DEST}/systemd/system/{service_name}.{service_type}'
|
||||||
|
symlink(source_filename, filename)
|
||||||
|
|
||||||
def post_instance_service(self,
|
def post_instance_service(self,
|
||||||
service_name: str,
|
service_name: str,
|
||||||
|
service_type: str,
|
||||||
) -> None: # pragma: no cover
|
) -> None: # pragma: no cover
|
||||||
if self.ip_per_service is None:
|
if self.ip_per_service is None:
|
||||||
return
|
return
|
||||||
destfile = f'/systemd/system/{service_name}.service.d/rougail_ip.conf'
|
destfile = f'/systemd/system/{service_name}.{service_type}.d/rougail_ip.conf'
|
||||||
destfilename = join(self.destinations_dir, destfile[1:])
|
destfilename = join(self.destinations_dir, destfile[1:])
|
||||||
makedirs(dirname(destfilename), exist_ok=True)
|
makedirs(dirname(destfilename), exist_ok=True)
|
||||||
self.log.info(_(f"creole processing: '{destfilename}'"))
|
self.log.info(_(f"creole processing: '{destfilename}'"))
|
||||||
|
@ -243,7 +243,7 @@ class Common:
|
|||||||
):
|
):
|
||||||
"""Populate variable parameters
|
"""Populate variable parameters
|
||||||
"""
|
"""
|
||||||
if param.type in ['number', 'boolean', 'nil', 'string', 'port']:
|
if param.type in ['number', 'boolean', 'nil', 'string', 'port', 'choice']:
|
||||||
value = param.text
|
value = param.text
|
||||||
if param.type == 'string' and value is not None:
|
if param.type == 'string' and value is not None:
|
||||||
value = self.convert_str(value)
|
value = self.convert_str(value)
|
||||||
@ -251,7 +251,11 @@ class Common:
|
|||||||
if param.type == 'variable':
|
if param.type == 'variable':
|
||||||
return self.build_option_param(param)
|
return self.build_option_param(param)
|
||||||
if param.type == 'information':
|
if param.type == 'information':
|
||||||
return f'ParamInformation("{param.text}", None)'
|
if hasattr(self.elt, 'multi') and self.elt.multi:
|
||||||
|
default = []
|
||||||
|
else:
|
||||||
|
default = None
|
||||||
|
return f'ParamInformation("{param.text}", {default})'
|
||||||
if param.type == 'target_information':
|
if param.type == 'target_information':
|
||||||
return f'ParamSelfInformation("{param.text}", None)'
|
return f'ParamSelfInformation("{param.text}", None)'
|
||||||
if param.type == 'suffix':
|
if param.type == 'suffix':
|
||||||
@ -294,13 +298,13 @@ class Variable(Common):
|
|||||||
):
|
):
|
||||||
if hasattr(self.elt, 'opt'):
|
if hasattr(self.elt, 'opt'):
|
||||||
keys['opt'] = self.elt.opt.reflector_object.get()
|
keys['opt'] = self.elt.opt.reflector_object.get()
|
||||||
if hasattr(self.elt, 'values'):
|
if hasattr(self.elt, 'choice'):
|
||||||
values = self.elt.values
|
values = self.elt.choice
|
||||||
if values[0].type == 'variable':
|
if values[0].type == 'variable':
|
||||||
value = values[0].name.reflector_object.get()
|
value = values[0].name.reflector_object.get()
|
||||||
keys['values'] = f"Calculation(func.calc_value, Params((ParamOption({value}))))"
|
keys['values'] = f"Calculation(func.calc_value, Params((ParamOption({value}))))"
|
||||||
elif values[0].type == 'function':
|
elif values[0].type == 'function':
|
||||||
keys['values'] = self.calculation_value(self.elt.values[0], [])
|
keys['values'] = self.calculation_value(values[0], [])
|
||||||
else:
|
else:
|
||||||
keys['values'] = str(tuple([val.name for val in values]))
|
keys['values'] = str(tuple([val.name for val in values]))
|
||||||
if hasattr(self.elt, 'multi') and self.elt.multi:
|
if hasattr(self.elt, 'multi') and self.elt.multi:
|
||||||
@ -371,7 +375,7 @@ class Family(Common):
|
|||||||
if hasattr(self.elt, 'suffixes'):
|
if hasattr(self.elt, 'suffixes'):
|
||||||
self.objectspace.has_dyn_option = True
|
self.objectspace.has_dyn_option = True
|
||||||
self.object_type = 'ConvertDynOptionDescription'
|
self.object_type = 'ConvertDynOptionDescription'
|
||||||
elif isinstance(self.elt, self.objectspace.leadership):
|
elif hasattr(self.elt, 'leadership') and self.elt.leadership:
|
||||||
self.object_type = 'Leadership'
|
self.object_type = 'Leadership'
|
||||||
else:
|
else:
|
||||||
self.object_type = 'OptionDescription'
|
self.object_type = 'OptionDescription'
|
||||||
|
@ -31,10 +31,11 @@ from .i18n import _
|
|||||||
from .error import UpgradeError
|
from .error import UpgradeError
|
||||||
|
|
||||||
from .utils import normalize_family
|
from .utils import normalize_family
|
||||||
|
from .config import RougailConfig
|
||||||
|
|
||||||
|
|
||||||
VERSIONS = {'creole': ['1'],
|
VERSIONS = {'creole': ['1'],
|
||||||
'rougail': ['0.9'],
|
'rougail': ['0.9', '0.10'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -47,16 +48,24 @@ FUNCTION_VERSIONS = [(root, version, get_function_name(root, version)) for root,
|
|||||||
|
|
||||||
|
|
||||||
class RougailUpgrade:
|
class RougailUpgrade:
|
||||||
def __init__(self, test=False, upgrade_help=None):
|
def __init__(self,
|
||||||
|
test=False,
|
||||||
|
upgrade_help=None,
|
||||||
|
rougailconfig: RougailConfig=None,
|
||||||
|
) -> None:
|
||||||
self.test = test
|
self.test = test
|
||||||
if upgrade_help is None:
|
if upgrade_help is None:
|
||||||
upgrade_help = {}
|
upgrade_help = {}
|
||||||
self.upgrade_help = upgrade_help
|
self.upgrade_help = upgrade_help
|
||||||
|
if rougailconfig is None:
|
||||||
|
rougailconfig = RougailConfig
|
||||||
|
self.rougailconfig = rougailconfig
|
||||||
|
|
||||||
def load_xml_from_folders(self,
|
def load_xml_from_folders(self,
|
||||||
srcfolder: str,
|
srcfolder: str,
|
||||||
dstfolder: str,
|
dstfolder: str,
|
||||||
namespace: str,
|
namespace: str,
|
||||||
|
display: bool=True,
|
||||||
):
|
):
|
||||||
"""Loads all the XML files located in the xmlfolders' list
|
"""Loads all the XML files located in the xmlfolders' list
|
||||||
|
|
||||||
@ -67,6 +76,8 @@ class RougailUpgrade:
|
|||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
xmlsrc = join(srcfolder, filename)
|
xmlsrc = join(srcfolder, filename)
|
||||||
xmldst = join(dstfolder, filename)
|
xmldst = join(dstfolder, filename)
|
||||||
|
if isfile(xmldst):
|
||||||
|
raise Exception(f'cannot update "{xmlsrc}" destination file "{xmldst}" already exists')
|
||||||
try:
|
try:
|
||||||
parser = XMLParser(remove_blank_text=True)
|
parser = XMLParser(remove_blank_text=True)
|
||||||
document = parse(xmlsrc, parser)
|
document = parse(xmlsrc, parser)
|
||||||
@ -77,6 +88,7 @@ class RougailUpgrade:
|
|||||||
function_found = False
|
function_found = False
|
||||||
for root_name, version, function_version in FUNCTION_VERSIONS:
|
for root_name, version, function_version in FUNCTION_VERSIONS:
|
||||||
if function_found and hasattr(self, function_version):
|
if function_found and hasattr(self, function_version):
|
||||||
|
if display:
|
||||||
print(f' - convert {filename} to version {version}')
|
print(f' - convert {filename} to version {version}')
|
||||||
upgrade_help = self.upgrade_help.get(function_version, {}).get(filename, {})
|
upgrade_help = self.upgrade_help.get(function_version, {}).get(filename, {})
|
||||||
if upgrade_help.get('remove') is True:
|
if upgrade_help.get('remove') is True:
|
||||||
@ -84,6 +96,7 @@ class RougailUpgrade:
|
|||||||
root = getattr(self, function_version)(root, upgrade_help, namespace)
|
root = getattr(self, function_version)(root, upgrade_help, namespace)
|
||||||
if function_version == search_function_name:
|
if function_version == search_function_name:
|
||||||
function_found = True
|
function_found = True
|
||||||
|
root.attrib['version'] = version
|
||||||
with open(xmldst, 'wb') as xmlfh:
|
with open(xmldst, 'wb') as xmlfh:
|
||||||
xmlfh.write(tostring(root, pretty_print=True, encoding="UTF-8", xml_declaration=True))
|
xmlfh.write(tostring(root, pretty_print=True, encoding="UTF-8", xml_declaration=True))
|
||||||
# if
|
# if
|
||||||
@ -94,6 +107,182 @@ class RougailUpgrade:
|
|||||||
# yield xmlfile, document.getroot()
|
# yield xmlfile, document.getroot()
|
||||||
|
|
||||||
|
|
||||||
|
def update_rougail_0_10(self,
|
||||||
|
root: 'Element',
|
||||||
|
upgrade_help: dict,
|
||||||
|
namespace: str,
|
||||||
|
) -> 'Element':
|
||||||
|
variables = root.find('variables')
|
||||||
|
if variables is None:
|
||||||
|
return root
|
||||||
|
paths = self._get_path_variables(variables,
|
||||||
|
namespace == self.rougailconfig['variable_namespace'],
|
||||||
|
namespace,
|
||||||
|
)
|
||||||
|
constraints = root.find('constraints')
|
||||||
|
# convert schedule and schedulemod
|
||||||
|
for variable in paths.values():
|
||||||
|
variable = variable['variable']
|
||||||
|
if variable.tag != 'variable':
|
||||||
|
continue
|
||||||
|
if 'type' in variable.attrib and variable.attrib['type'] in ['schedule', 'schedulemod']:
|
||||||
|
if variable.attrib['type'] == 'schedule':
|
||||||
|
choices = ('none', 'daily', 'weekly', 'monthly')
|
||||||
|
else:
|
||||||
|
choices = ('pre', 'post')
|
||||||
|
variable.attrib['type'] = 'choice'
|
||||||
|
has_value = False
|
||||||
|
for value in variable:
|
||||||
|
if value.tag == 'value':
|
||||||
|
has_value = True
|
||||||
|
break
|
||||||
|
for name in choices:
|
||||||
|
choice = SubElement(variable, 'choice')
|
||||||
|
choice.text = name
|
||||||
|
if not has_value:
|
||||||
|
value = SubElement(variable, 'value')
|
||||||
|
value.text = choices[0]
|
||||||
|
variable.attrib['mandatory'] = 'True'
|
||||||
|
|
||||||
|
# convert group to leadership
|
||||||
|
groups = []
|
||||||
|
if constraints is not None:
|
||||||
|
for constraint in constraints:
|
||||||
|
if constraint.tag == 'group':
|
||||||
|
constraints.remove(constraint)
|
||||||
|
groups.append(constraint)
|
||||||
|
for group in groups:
|
||||||
|
if group.attrib['leader'] in paths:
|
||||||
|
leader_obj = paths[group.attrib['leader']]
|
||||||
|
#FIXME name peut avoir "." il faut le virer
|
||||||
|
#FIXME si extra c'est un follower !
|
||||||
|
if 'name' in group.attrib:
|
||||||
|
grpname = group.attrib['name']
|
||||||
|
if 'description' in group.attrib:
|
||||||
|
description = group.attrib['description']
|
||||||
|
else:
|
||||||
|
description = grpname
|
||||||
|
else:
|
||||||
|
grpname = leader_obj['variable'].attrib['name']
|
||||||
|
if '.' in grpname:
|
||||||
|
grpname = grpname.rsplit('.', 1)[-1]
|
||||||
|
if 'description' in group.attrib:
|
||||||
|
description = group.attrib['description']
|
||||||
|
elif 'description' in leader_obj['variable'].attrib:
|
||||||
|
description = leader_obj['variable'].attrib['description']
|
||||||
|
else:
|
||||||
|
description = grpname
|
||||||
|
family = SubElement(leader_obj['parent'], 'family', name=grpname, description=description, leadership="True")
|
||||||
|
leader_obj['parent'].remove(leader_obj['variable'])
|
||||||
|
family.append(leader_obj['variable'])
|
||||||
|
else:
|
||||||
|
# append in group
|
||||||
|
follower = next(iter(group))
|
||||||
|
leader_name = group.attrib['leader']
|
||||||
|
if '.' in leader_name:
|
||||||
|
leader_path = leader_name.rsplit('.', 1)[0]
|
||||||
|
follower_path = leader_path + '.' + follower.text
|
||||||
|
else:
|
||||||
|
follower_path = follower.text
|
||||||
|
obj = paths[follower_path]
|
||||||
|
family = SubElement(obj['parent'], 'family', name=leader_name, leadership="True")
|
||||||
|
grpname = leader_name
|
||||||
|
for follower in group:
|
||||||
|
leader_name = group.attrib['leader']
|
||||||
|
if '.' in leader_name:
|
||||||
|
leader_path = leader_name.rsplit('.', 1)[0]
|
||||||
|
follower_path = leader_path + '.' + follower.text
|
||||||
|
else:
|
||||||
|
follower_path = follower.text
|
||||||
|
follower_obj = paths[follower_path]
|
||||||
|
follower_obj['parent'].remove(follower_obj['variable'])
|
||||||
|
family.append(follower_obj['variable'])
|
||||||
|
if '.' in follower_path:
|
||||||
|
new_path = follower_path.rsplit('.', 1)[0] + '.' + grpname + '.' + follower_path.rsplit('.', 1)[1]
|
||||||
|
paths[new_path] = paths[follower_path]
|
||||||
|
|
||||||
|
# convert choice option
|
||||||
|
valid_enums = []
|
||||||
|
if constraints is not None:
|
||||||
|
for constraint in constraints:
|
||||||
|
if constraint.tag == 'check' and constraint.attrib['name'] == 'valid_enum':
|
||||||
|
constraints.remove(constraint)
|
||||||
|
valid_enums.append(constraint)
|
||||||
|
for valid_enum in valid_enums:
|
||||||
|
targets = []
|
||||||
|
for target in valid_enum:
|
||||||
|
if target.tag != 'target':
|
||||||
|
continue
|
||||||
|
if target.text in paths:
|
||||||
|
# not in paths if it's optional
|
||||||
|
# but not check it
|
||||||
|
targets.append(paths[target.text]['variable'])
|
||||||
|
params = []
|
||||||
|
function_param = None
|
||||||
|
for param in valid_enum:
|
||||||
|
if param.tag != 'param':
|
||||||
|
continue
|
||||||
|
if 'type' in param.attrib and param.attrib['type'] == 'function':
|
||||||
|
function_param = param.text
|
||||||
|
continue
|
||||||
|
params.append(param)
|
||||||
|
first_choice = None
|
||||||
|
for target in targets:
|
||||||
|
if function_param is not None:
|
||||||
|
function = SubElement(target, 'choice', type='function', name=function_param)
|
||||||
|
for param in params:
|
||||||
|
if function_param is not None:
|
||||||
|
function.append(param)
|
||||||
|
else:
|
||||||
|
choice = SubElement(target, 'choice')
|
||||||
|
if first_choice is None:
|
||||||
|
first_choice = choice
|
||||||
|
choice.text = param.text
|
||||||
|
if 'type' not in param.attrib and param.text is None:
|
||||||
|
choice_type = 'nil'
|
||||||
|
elif 'type' in param.attrib:
|
||||||
|
choice_type = param.attrib['type']
|
||||||
|
elif 'type' in target.attrib:
|
||||||
|
choice_type = target.attrib['type']
|
||||||
|
else:
|
||||||
|
choice_type = 'string'
|
||||||
|
choice.attrib['type'] = choice_type
|
||||||
|
has_value = False
|
||||||
|
for target in targets:
|
||||||
|
if 'remove_check' in target.attrib:
|
||||||
|
target.attrib['remove_choice'] = target.attrib['remove_check']
|
||||||
|
for target in targets:
|
||||||
|
for value in target:
|
||||||
|
if value.tag == 'value':
|
||||||
|
has_value = True
|
||||||
|
if 'type' in target.attrib:
|
||||||
|
value.attrib['type'] = target.attrib['type']
|
||||||
|
if first_choice is not None and not has_value:
|
||||||
|
value = SubElement(target, 'value')
|
||||||
|
value.attrib['type'] = first_choice.attrib['type']
|
||||||
|
value.text = first_choice.text
|
||||||
|
for target in targets:
|
||||||
|
if 'remove_choice' not in target.attrib or target.attrib['remove_choice'] != 'True':
|
||||||
|
target.attrib['type'] = 'choice'
|
||||||
|
return root
|
||||||
|
|
||||||
|
def _get_path_variables(self, variables, is_variable_namespace, path, dico=None):
|
||||||
|
if dico is None:
|
||||||
|
dico = {}
|
||||||
|
for variable in variables:
|
||||||
|
if not is_variable_namespace and path:
|
||||||
|
subpath = path + '.'
|
||||||
|
else:
|
||||||
|
subpath = ''
|
||||||
|
if variable.tag not in ['variable', 'family']:
|
||||||
|
continue
|
||||||
|
subpath += variable.attrib['name']
|
||||||
|
if variable.tag == 'family':
|
||||||
|
self._get_path_variables(variable, is_variable_namespace, subpath, dico)
|
||||||
|
elif variable.tag == 'variable':
|
||||||
|
dico[subpath] = {'variable': variable, 'parent': variables}
|
||||||
|
return dico
|
||||||
|
|
||||||
def update_rougail_0_9(self,
|
def update_rougail_0_9(self,
|
||||||
root: 'Element',
|
root: 'Element',
|
||||||
upgrade_help: dict,
|
upgrade_help: dict,
|
||||||
@ -101,7 +290,6 @@ class RougailUpgrade:
|
|||||||
) -> 'Element':
|
) -> 'Element':
|
||||||
# rename root
|
# rename root
|
||||||
root.tag = 'rougail'
|
root.tag = 'rougail'
|
||||||
root.attrib['version'] = '0.9'
|
|
||||||
variables_auto_valid_enum = {}
|
variables_auto_valid_enum = {}
|
||||||
variables_help = {}
|
variables_help = {}
|
||||||
families_help = {}
|
families_help = {}
|
||||||
@ -146,7 +334,7 @@ class RougailUpgrade:
|
|||||||
subsubsubelement.attrib['mandatory'] = 'True'
|
subsubsubelement.attrib['mandatory'] = 'True'
|
||||||
if subsubsubelement.attrib['name'] in upgrade_help.get('variables', {}).get('type', {}):
|
if subsubsubelement.attrib['name'] in upgrade_help.get('variables', {}).get('type', {}):
|
||||||
subsubsubelement.attrib['type'] = upgrade_help.get('variables', {}).get('type', {})[subsubsubelement.attrib['name']]
|
subsubsubelement.attrib['type'] = upgrade_help.get('variables', {}).get('type', {})[subsubsubelement.attrib['name']]
|
||||||
if namespace == 'configuration':
|
if namespace == self.rougailconfig['variable_namespace']:
|
||||||
path = subsubsubelement.attrib['name']
|
path = subsubsubelement.attrib['name']
|
||||||
npath = normalize_family(subsubsubelement.attrib['name'])
|
npath = normalize_family(subsubsubelement.attrib['name'])
|
||||||
else:
|
else:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<services>
|
<services>
|
||||||
<service name="tata">
|
<service name="tata">
|
||||||
</service>
|
</service>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="myvar" auto_freeze="True">
|
<variable name="myvar" auto_freeze="True">
|
||||||
<value>no</value>
|
<value>no</value>
|
||||||
@ -9,5 +9,3 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="my_var" auto_freeze="True" mode="expert">
|
<variable name="my_var" auto_freeze="True" mode="expert">
|
||||||
<value>no</value>
|
<value>no</value>
|
||||||
@ -9,5 +9,3 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="server_deployed" type="boolean"/>
|
<variable name="server_deployed" type="boolean"/>
|
||||||
<family name="general" description="général">
|
<family name="general" description="général">
|
||||||
@ -9,5 +9,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="server_deployed" type="boolean"/>
|
<variable name="server_deployed" type="boolean"/>
|
||||||
<family name="general" description="général">
|
<family name="general" description="général">
|
||||||
@ -9,5 +9,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general" description="général">
|
<family name="general" description="général">
|
||||||
<!-- this is a comment -->
|
<!-- this is a comment -->
|
||||||
@ -9,5 +9,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general" description="général">
|
<family name="general" description="général">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||||
@ -11,5 +11,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general" description="général">
|
<family name="general" description="général">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general" description="général">
|
<family name="general" description="général">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<rougail version="0.10">
|
||||||
<rougail version="0.9">
|
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general" description="général">
|
<family name="general" description="général">
|
||||||
<variable name='mode_conteneur_actif1' type='string' description="No change" hidden="True">
|
<variable name="mode_conteneur_actif1" type="string" description="No change" hidden="True">
|
||||||
<value>non</value>
|
<value>non</value>
|
||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="server_deployed" type="boolean">
|
<variable name="server_deployed" type="boolean">
|
||||||
<value>no</value>
|
<value>no</value>
|
||||||
@ -15,5 +15,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||||
@ -10,7 +10,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param type="variable">mode_conteneur_actif1</param>
|
<param type="variable">mode_conteneur_actif1</param>
|
||||||
@ -18,5 +17,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||||
@ -10,12 +10,9 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<target>mode_conteneur_actif</target>
|
<target>mode_conteneur_actif</target>
|
||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="domain" type="domainname" description="Description">
|
<variable name="domain" type="domainname" description="Description">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
|
|
||||||
<services>
|
<services>
|
||||||
<service name="test">
|
<service name="test">
|
||||||
<file>/etc/file</file>
|
<file>/etc/file</file>
|
||||||
<file engine="jinja2">/etc/file2</file>
|
<file engine="jinja2">/etc/file2</file>
|
||||||
</service>
|
</service>
|
||||||
</services>
|
</services>
|
||||||
|
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Description">
|
<variable name="mode_conteneur_actif" type="string" description="Description">
|
||||||
@ -16,5 +14,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
|
|
||||||
<services>
|
<services>
|
||||||
<service name="test">
|
<service name="test">
|
||||||
<file>/etc/file</file>
|
<file>/etc/file</file>
|
||||||
<file engine="jinja2">/etc/file2</file>
|
<file engine="jinja2">/etc/file2</file>
|
||||||
</service>
|
</service>
|
||||||
</services>
|
</services>
|
||||||
|
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Description">
|
<variable name="mode_conteneur_actif" type="string" description="Description">
|
||||||
@ -16,5 +14,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
|
|
||||||
<services>
|
<services>
|
||||||
<service name="test">
|
<service name="test">
|
||||||
<file>/etc/file</file>
|
<file>/etc/file</file>
|
||||||
@ -8,7 +7,6 @@
|
|||||||
<file included="content">/etc/dir/incfile</file>
|
<file included="content">/etc/dir/incfile</file>
|
||||||
</service>
|
</service>
|
||||||
</services>
|
</services>
|
||||||
|
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Description">
|
<variable name="mode_conteneur_actif" type="string" description="Description">
|
||||||
@ -17,5 +15,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
|
|
||||||
<services>
|
<services>
|
||||||
<service name="test">
|
<service name="test">
|
||||||
<file>/etc/file</file>
|
<file>/etc/file</file>
|
||||||
@ -8,7 +7,6 @@
|
|||||||
<file included="name">/etc/dir/incfile</file>
|
<file included="name">/etc/dir/incfile</file>
|
||||||
</service>
|
</service>
|
||||||
</services>
|
</services>
|
||||||
|
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Description">
|
<variable name="mode_conteneur_actif" type="string" description="Description">
|
||||||
@ -17,5 +15,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
|
|
||||||
<services>
|
<services>
|
||||||
<service name="test">
|
<service name="test">
|
||||||
<file>/etc/file</file>
|
<file>/etc/file</file>
|
||||||
<file engine="jinja2">/etc/file2</file>
|
<file engine="jinja2">/etc/file2</file>
|
||||||
</service>
|
</service>
|
||||||
</services>
|
</services>
|
||||||
|
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Description">
|
<variable name="mode_conteneur_actif" type="string" description="Description">
|
||||||
@ -16,5 +14,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
|
|
||||||
<services>
|
<services>
|
||||||
<service name="test">
|
<service name="test">
|
||||||
<file>/etc/systemd-makefs@dev-disk-by\x2dpartlabel</file>
|
<file>/etc/systemd-makefs@dev-disk-by\x2dpartlabel</file>
|
||||||
<file engine="jinja2">/etc/systemd-makefs@dev-disk-by\x2dpartlabel2</file>
|
<file engine="jinja2">/etc/systemd-makefs@dev-disk-by\x2dpartlabel2</file>
|
||||||
</service>
|
</service>
|
||||||
</services>
|
</services>
|
||||||
|
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Description">
|
<variable name="mode_conteneur_actif" type="string" description="Description">
|
||||||
@ -16,5 +14,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="float" type="float" description="Description">
|
<variable name="float" type="float" description="Description">
|
||||||
@ -11,5 +11,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Redefine description" help="message with '"/>
|
<variable name="mode_conteneur_actif" type="string" description="Redefine description" help="message with '"/>
|
||||||
<variable name="mode_conteneur_actif1" type="string" description="Redefine description" help='message with "'/>
|
<variable name="mode_conteneur_actif1" type="string" description="Redefine description" help="message with ""/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
|
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
|
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
|
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
|
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
|
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
|
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
|
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
|
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="general" type="string" description="description">
|
<variable name="general" type="string" description="description">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="my_variable" type="boolean" mandatory="False"/>
|
<variable name="my_variable" type="boolean" mandatory="False"/>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general" description="Other description">
|
<family name="general" description="Other description">
|
||||||
<variable name="mode_conteneur_actif">
|
<variable name="mode_conteneur_actif">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="my_var1" auto_freeze="True">
|
<variable name="my_var1" auto_freeze="True">
|
||||||
<value>no</value>
|
<value>no</value>
|
||||||
@ -11,7 +11,6 @@
|
|||||||
<value>False</value>
|
<value>False</value>
|
||||||
</variable>
|
</variable>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param type="variable">my_var2</param>
|
<param type="variable">my_var2</param>
|
||||||
@ -19,5 +18,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="server_deployed" type="boolean"/>
|
<variable name="server_deployed" type="boolean"/>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
@ -11,7 +11,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param type="variable">mode_conteneur_actif1</param>
|
<param type="variable">mode_conteneur_actif1</param>
|
||||||
@ -19,5 +18,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change"/>
|
<variable name="mode_conteneur_actif" type="string" description="No change"/>
|
||||||
@ -8,7 +8,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param type="variable">mode_conteneur_actif1</param>
|
<param type="variable">mode_conteneur_actif1</param>
|
||||||
@ -16,5 +15,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general" mode="basic">
|
<family name="general" mode="basic">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change" mandatory="True" mode="expert"/>
|
<variable name="mode_conteneur_actif" type="string" description="No change" mandatory="True" mode="expert"/>
|
||||||
@ -8,7 +8,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param type="variable">mode_conteneur_actif1</param>
|
<param type="variable">mode_conteneur_actif1</param>
|
||||||
@ -16,5 +15,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="number" description="No change" hidden="True"/>
|
<variable name="mode_conteneur_actif" type="number" description="No change" hidden="True"/>
|
||||||
@ -8,7 +8,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param type="number">3</param>
|
<param type="number">3</param>
|
||||||
@ -16,5 +15,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||||
@ -10,7 +10,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param type="variable" optional="True">mode_conteneur_actif4</param>
|
<param type="variable" optional="True">mode_conteneur_actif4</param>
|
||||||
@ -18,5 +17,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
|
||||||
@ -10,7 +10,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param type="variable" optional="True">mode_conteneur_actif4</param>
|
<param type="variable" optional="True">mode_conteneur_actif4</param>
|
||||||
@ -20,5 +19,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change"/>
|
<variable name="mode_conteneur_actif" type="string" description="No change"/>
|
||||||
@ -8,7 +8,6 @@
|
|||||||
<variable name="mode_conteneur_actif3" type="string" description="No change"/>
|
<variable name="mode_conteneur_actif3" type="string" description="No change"/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param>quote'</param>
|
<param>quote'</param>
|
||||||
@ -28,5 +27,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif1" type="string" description="No change">
|
<variable name="mode_conteneur_actif1" type="string" description="No change">
|
||||||
@ -7,7 +7,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param type="variable">mode_conteneur_actif1</param>
|
<param type="variable">mode_conteneur_actif1</param>
|
||||||
@ -15,5 +14,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="server_deployed" type="boolean">
|
<variable name="server_deployed" type="boolean">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
@ -19,5 +19,3 @@
|
|||||||
</condition>
|
</condition>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" test="test">
|
<variable name="mode_conteneur_actif" test="test">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" test="test1|test2">
|
<variable name="mode_conteneur_actif" test="test1|test2">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" test="|test1|test2">
|
<variable name="mode_conteneur_actif" test="|test1|test2">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" test="test">
|
<variable name="mode_conteneur_actif" test="test">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" redefine="True" test="test1"/>
|
<variable name="mode_conteneur_actif" redefine="True" test="test1"/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="my_variable"/>
|
<variable name="my_variable"/>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="my_variable" redefine="True" test="test1"/>
|
<variable name="my_variable" redefine="True" test="test1"/>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" test="test">
|
<variable name="mode_conteneur_actif" test="test">
|
||||||
@ -8,5 +8,3 @@
|
|||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" redefine="True" test=""/>
|
<variable name="mode_conteneur_actif" redefine="True" test=""/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="server_deployed" type="boolean"/>
|
<variable name="server_deployed" type="boolean"/>
|
||||||
<family name="general" description="général">
|
<family name="general" description="général">
|
||||||
@ -20,5 +20,3 @@
|
|||||||
</condition>
|
</condition>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="var1">
|
<variable name="var1">
|
||||||
<value>no</value>
|
<value>no</value>
|
||||||
</variable>
|
</variable>
|
||||||
<variable name="var2" multi='True'/>
|
<variable name="var2" multi="True"/>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_value">
|
<fill name="calc_value">
|
||||||
<param type="variable">var1</param>
|
<param type="variable">var1</param>
|
||||||
@ -15,5 +14,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="var1" multi='True'>
|
<variable name="var1" multi="True">
|
||||||
<value>no</value>
|
<value>no</value>
|
||||||
<value>yes</value>
|
<value>yes</value>
|
||||||
<value>maybe</value>
|
<value>maybe</value>
|
||||||
</variable>
|
</variable>
|
||||||
<variable name="var2" multi='True'/>
|
<variable name="var2" multi="True"/>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_value">
|
<fill name="calc_value">
|
||||||
<param type="variable">var1</param>
|
<param type="variable">var1</param>
|
||||||
@ -16,5 +15,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="server_deployed" type="boolean"/>
|
<variable name="server_deployed" type="boolean"/>
|
||||||
<family name="general" description="général">
|
<family name="general" description="général">
|
||||||
@ -9,7 +9,6 @@
|
|||||||
<variable name="autosavevar" type="string" description="autosave variable" hidden="True" auto_save="True"/>
|
<variable name="autosavevar" type="string" description="autosave variable" hidden="True" auto_save="True"/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param>oui</param>
|
<param>oui</param>
|
||||||
@ -17,5 +16,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||||
@ -16,5 +16,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="my_variable"/>
|
<variable name="my_variable"/>
|
||||||
</variables>
|
</variables>
|
||||||
@ -11,5 +11,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||||
@ -8,12 +8,9 @@
|
|||||||
<variable name="int" type="number" description="No change"/>
|
<variable name="int" type="number" description="No change"/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<check name="valid_lower">
|
<check name="valid_lower">
|
||||||
<target>int</target>
|
<target>int</target>
|
||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||||
@ -11,7 +11,6 @@
|
|||||||
<variable name="int" type="number" description="No change"/>
|
<variable name="int" type="number" description="No change"/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<check name="valid_lower">
|
<check name="valid_lower">
|
||||||
<param name="mini" type="number">0</param>
|
<param name="mini" type="number">0</param>
|
||||||
@ -20,5 +19,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||||
@ -9,7 +9,6 @@
|
|||||||
<variable name="int2" type="number" description="No change"/>
|
<variable name="int2" type="number" description="No change"/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<check name="valid_differ">
|
<check name="valid_differ">
|
||||||
<param type="variable" optional="True">int2</param>
|
<param type="variable" optional="True">int2</param>
|
||||||
@ -21,5 +20,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||||
@ -10,7 +10,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<check name="valid_differ">
|
<check name="valid_differ">
|
||||||
<param type="variable">mode_conteneur_actif1</param>
|
<param type="variable">mode_conteneur_actif1</param>
|
||||||
@ -18,5 +17,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||||
@ -16,7 +16,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<check name="valid_differ">
|
<check name="valid_differ">
|
||||||
<param type="variable">mode_conteneur_actif1</param>
|
<param type="variable">mode_conteneur_actif1</param>
|
||||||
@ -24,5 +23,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif3" redefine="True"/>
|
<variable name="mode_conteneur_actif3" redefine="True"/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<check name="valid_differ">
|
<check name="valid_differ">
|
||||||
<param type="variable">mode_conteneur_actif1</param>
|
<param type="variable">mode_conteneur_actif1</param>
|
||||||
@ -17,5 +16,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||||
@ -16,7 +16,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<check name="valid_differ">
|
<check name="valid_differ">
|
||||||
<param type="variable">mode_conteneur_actif1</param>
|
<param type="variable">mode_conteneur_actif1</param>
|
||||||
@ -24,5 +23,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif3" redefine="True" remove_check="True">
|
<variable name="mode_conteneur_actif3" redefine="True" remove_check="True">
|
||||||
@ -7,7 +7,6 @@
|
|||||||
</variable>
|
</variable>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<check name="valid_differ">
|
<check name="valid_differ">
|
||||||
<param type="variable">mode_conteneur_actif1</param>
|
<param type="variable">mode_conteneur_actif1</param>
|
||||||
@ -19,5 +18,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||||
@ -10,7 +10,6 @@
|
|||||||
<variable name="adresse_ip" type="local_ip" description="IP" mandatory="True" mode="basic"/>
|
<variable name="adresse_ip" type="local_ip" description="IP" mandatory="True" mode="basic"/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<check name="valid_in_network" level="warning">
|
<check name="valid_in_network" level="warning">
|
||||||
<param type="variable">adresse_ip_eth0</param>
|
<param type="variable">adresse_ip_eth0</param>
|
||||||
@ -19,5 +18,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||||
@ -9,7 +9,6 @@
|
|||||||
<variable name="adresse_ip" type="local_ip" description="IP" mandatory="True" mode="basic"/>
|
<variable name="adresse_ip" type="local_ip" description="IP" mandatory="True" mode="basic"/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<check name="valid_in_network" level="warning">
|
<check name="valid_in_network" level="warning">
|
||||||
<param type="variable">adresse_ip_eth0</param>
|
<param type="variable">adresse_ip_eth0</param>
|
||||||
@ -17,5 +16,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change">
|
<variable name="mode_conteneur_actif" type="string" description="No change">
|
||||||
@ -9,7 +9,6 @@
|
|||||||
<variable name="adresse_netmask_eth0" type="netmask" description="Masque de sous réseau de la carte" mandatory="True" mode="basic"/>
|
<variable name="adresse_netmask_eth0" type="netmask" description="Masque de sous réseau de la carte" mandatory="True" mode="basic"/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<check name="valid_ipnetmask" level="warning">
|
<check name="valid_ipnetmask" level="warning">
|
||||||
<param type="variable">adresse_ip_eth0</param>
|
<param type="variable">adresse_ip_eth0</param>
|
||||||
@ -17,5 +16,3 @@
|
|||||||
</check>
|
</check>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<rougail version="0.9">
|
<rougail version="0.10">
|
||||||
<variables>
|
<variables>
|
||||||
<family name="general">
|
<family name="general">
|
||||||
<variable name="mode_conteneur_actif" type="string" description="No change"/>
|
<variable name="mode_conteneur_actif" type="string" description="No change"/>
|
||||||
</family>
|
</family>
|
||||||
</variables>
|
</variables>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
<fill name="calc_val">
|
<fill name="calc_val">
|
||||||
<param type="information">test_information</param>
|
<param type="information">test_information</param>
|
||||||
@ -13,5 +12,3 @@
|
|||||||
</fill>
|
</fill>
|
||||||
</constraints>
|
</constraints>
|
||||||
</rougail>
|
</rougail>
|
||||||
<!-- vim: ts=4 sw=4 expandtab
|
|
||||||
-->
|
|
||||||
|
14
tests/dictionaries/10fill_information_multi/00-base.xml
Normal file
14
tests/dictionaries/10fill_information_multi/00-base.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<rougail version="0.10">
|
||||||
|
<variables>
|
||||||
|
<family name="general">
|
||||||
|
<variable name="mode_conteneur_actif" type="string" description="No change" multi="True"/>
|
||||||
|
</family>
|
||||||
|
</variables>
|
||||||
|
<constraints>
|
||||||
|
<fill name="calc_val">
|
||||||
|
<param type="information">test_information</param>
|
||||||
|
<target>mode_conteneur_actif</target>
|
||||||
|
</fill>
|
||||||
|
</constraints>
|
||||||
|
</rougail>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user