Tâche #13729
ERA - Scénario #13707: Script 40-icmp_static_rules non créé
Il n'est pas possible de passer une variable en disabled via le mécanisme de redefine
Status:
Fermé
Priority:
Normal
Assigned To:
Target version:
Remaining (hours):
0.0
Description
L'attribut disabled n'est pas surchargé lors de la redéfinition.
Dans le fichier le fichier /usr/lib/python2.7/dist-packages/creole/var_loader.py, remplacer :
if vdata['disabled'] is True: attrs['disabled'] = True
par :
if vdata['disabled'] is True or (newdata is not None and newdata['disabled'] is True): attrs['disabled'] = True
Associated revisions
il est maintenant possible de redéfinir la variable disabled (ref #13729 @1h)
ajout de l'attribut 'remove_condition' pour les variables (ref #13729 @2h)
Test unitaire pour redefine et remove_condition
- tests/dicos/redefine/*.xml : ajout de variables et de contraintes spécifiques
- tests/test_genconfig.py : ajout des tests associés dans "test_redefine()"
Ref: #13729 @30m
History
#1 Updated by Scrum Master over 5 years ago
- Status changed from Nouveau to En cours
#2 Updated by Scrum Master over 5 years ago
- Assigned To set to Emmanuel GARETTE
#3 Updated by Emmanuel GARETTE over 5 years ago
Sur un AmonEcole etb3, il n'y a pas de différence avec et sans le changement :
root@amonecole:~# cat pouet.py from creole.loader import creole_loader; c=creole_loader(load_extra=True); m = c.make_dict() keys = m.keys() keys.sort() for k in keys: print k, m[k] root@amonecole:~# python pouet.py > avant.txt
Je fais la modification puis :
root@amonecole:~# python pouet.py > apres.txt root@amonecole:~# diff -u avant.txt apres.txt --- avant.txt 2015-12-02 16:14:27.196103818 +0100 +++ apres.txt 2015-12-02 16:18:25.352149845 +0100 @@ -9278,7 +9278,7 @@ creole.onduleur.nut_ups_name.nut_ups_productid [None] creole.onduleur.nut_ups_name.nut_ups_serial [None] creole.onduleur.nut_ups_name.nut_ups_upstype [None] -creole.onduleur.nut_ups_password 50e98059494a752fdea4a48aea36be2631afbacf4ae4aea9a6521ce2 +creole.onduleur.nut_ups_password 36d4d2ffc8bac27b7f3fd855c9630d08edfec62ca83ad627c455f129 creole.openldap.ldap_cachesize 1000 creole.openldap.ldap_loglevel 0 creole.openldap.ldap_replication non
Seul le mot de passe NUT est changé (pas lié à ma modification).
#4 Updated by Emmanuel GARETTE over 5 years ago
- % Done changed from 0 to 100
- Remaining (hours) changed from 1.0 to 0.25
#5 Updated by Scrum Master over 5 years ago
- Status changed from En cours to Résolu
#6 Updated by Joël Cuissinat over 5 years ago
- Project changed from ERA to creole
#7 Updated by Joël Cuissinat over 5 years ago
- Status changed from Résolu to Fermé
- Remaining (hours) changed from 0.25 to 0.0
Validé par la création des tests unitaires.