Project

General

Profile

Tâche #9797

Distribution EOLE - Scénario #9754: Assistance aux utilisateurs (48-49)

calc_multi_condition gere mal les listes ?

Added by Christophe Dezé over 6 years ago. Updated over 6 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
11/24/2014
Due date:
% Done:

100%

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

Description

<fill name='calc_multi_condition' target='alias_eth2'>
    <param>['10.0.0.0','oui']</param>
    <param type='eole' name='condition_1'>net_eth2_10</param>
    <param type='eole' name='condition_2'>fw_proxypeda</param>
    <param name='match'>oui</param>
    <param name='mismatch'>non</param>
</fill>
>>> CreoleClient().get_creole('net_eth2_10')
u'10.0.0.0'
>>> CreoleClient().get_creole('fw_proxypeda')
u'oui'
>>> eosfunc.calc_multi_condition(['10.0.0.0','oui'],condition_1=CreoleClient().
get_creole('net_eth2_10'),condition_2=CreoleClient().get_creole('fw_proxypeda'))
u'oui'
>>> CreoleClient().get_creole('alias_eth2')
u'non'

Associated revisions

Revision 16b36fd6 (diff)
Added by Joël Cuissinat over 6 years ago

Correction de calc_multi_condition avec une liste

  • creole/eosfunc.py : correction de la fonction
  • tests/* : ajout du cas dans les tests unitaires

Fixes: #9797 @1h

History

#1 Updated by Emmanuel GARETTE over 6 years ago

  • Project changed from Distribution EOLE to creole

#2 Updated by Christophe Dezé over 6 years ago

if param.startswith('['):
        param = eval(param)
if isinstance(param, list) and len(param) != len(conditions):

c OK

#3 Updated by Joël Cuissinat over 6 years ago

  • Description updated (diff)

#4 Updated by Joël Cuissinat over 6 years ago

  • Tracker changed from Anomalie to Tâche
  • Estimated time set to 1.50 h
  • Parent task set to #9754
  • Remaining (hours) set to 1.5

NB : prévoir l'ajout du cas dans le test unitaire "test_genconfig.py".

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

  • Status changed from Nouveau to En cours
  • Assigned To set to Joël Cuissinat

#6 Updated by Joël Cuissinat over 6 years ago

  • Status changed from En cours to Résolu
  • % Done changed from 0 to 100

#7 Updated by Joël Cuissinat over 6 years ago

  • Remaining (hours) changed from 1.5 to 0.15

#8 Updated by Bruno Boiget over 6 years ago

  • Status changed from Résolu to Fermé
  • Remaining (hours) changed from 0.15 to 0.0

validé sur scribe 2.4.1 avec les ajouts suivantes dans 00_common.xml:

    <variable name='target_multi' type='oui/non' description="var de test multi_condition" mode='basic'/>

    <fill name='calc_multi_condition' target='target_multi'>
        <param>['2.4','2.4.1']</param>
        <param type='eole' name='condition_1'>eole_version</param>
        <param type='eole' name='condition_2'>eole_release</param>
        <param name='match'>oui</param>
        <param name='mismatch'>non</param>
    </fill>
root@scribe:~# CreoleGet target_multi
oui

en remplaçant par <param>['2.4','2.4.0']</param> :

root@scribe:~# CreoleGet target_multi
non

Also available in: Atom PDF