Project

General

Profile

Tâche #15778

creole - Scénario #15610: Corriger les problèmes liés à Creole 2.6

Traceback à l'affichage du diff gen_config sur AmonEcole

Added by Joël Cuissinat over 5 years ago. Updated over 5 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
04/04/2016
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:
Remaining (hours):
0.0

Description

Si on importe le fichier de configuration "etb3.amonecole/default-2.5.2", les valeurs se chargent mais si on essaie d'enregistrer ça plante :

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eolegenconfig/webapi.py", line 276, in validate_config
    diff = lib.diff_config(id_, zephir_sync=zephir_sync)
  File "/usr/lib/python2.7/dist-packages/eolegenconfig/lib.py", line 1043, in diff_config
    master_value = new_values[master_path][1]
KeyError: 'creole.dhcp.adresse_network_dhcp.adresse_network_dhcp'

Associated revisions

Revision 8bca1611 (diff)
Added by Emmanuel GARETTE over 5 years ago

les masters ne sont pas forcement modifiés quand les slaves le sont (ref #15778 @1h)

History

#1 Updated by Joël Cuissinat over 5 years ago

  • Project changed from creole to eole-genconfig

#2 Updated by Emmanuel GARETTE over 5 years ago

  • Status changed from Nouveau to En cours

#3 Updated by Emmanuel GARETTE over 5 years ago

  • Status changed from En cours to Résolu
  • Assigned To set to Emmanuel GARETTE
  • % Done changed from 0 to 100
  • Remaining (hours) changed from 2.0 to 0.25

Pour tester :

from eolegenconfig import lib
id_='pouet'
lib.get_config(id_)
lib.diff_config(id_)

Un script rapide pour valider qu'il n'y a pas de "perte" dans la migration de la conf :

from json import load
a=load(open('/tmp/config.eol', 'r'))
b=load(open('/etc/eole/config.eol', 'r'))

assert set(a.keys()) - set(b.keys()) == set()
assert set(b.keys()) - set(a.keys()) == set()

for i in a.keys():
 if i == '___version___':
  continue
 if a[i] != b[i]:
  if isinstance(b[i], dict):
   for j, val in enumerate(a[i]['val']):
    if str(j) in b[i]['val']:
     assert val == b[i]['val'][str(j)]
    else:
     print i, "index:", j, val, "pas de valeur dans b" 
  else:
   print i, a[i]['val'], b[i]['val']

#4 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

Problème non reproduit.

Also available in: Atom PDF