2024-07-06 15:26:01 +02:00
from tiramisu import *
from tiramisu . setting import ALLOWED_LEADER_PROPERTIES
2024-08-29 08:32:08 +02:00
from re import compile as re_compile
2024-07-06 15:26:01 +02:00
from rougail . tiramisu import func , dict_env , load_functions , ConvertDynOptionDescription
load_functions ( ' tests/dictionaries/../eosfunc/test.py ' )
ALLOWED_LEADER_PROPERTIES . add ( " basic " )
ALLOWED_LEADER_PROPERTIES . add ( " standard " )
ALLOWED_LEADER_PROPERTIES . add ( " advanced " )
dict_env [ ' validators_rougail.netmask_address_eth0 ' ] = " { % i f not _.netmask_address_eth0 | valid_in_network(_.network_address_eth0) % } \n {{ _.netmask_address_eth0 }} is not a netmask for network {{ _.network_address_eth0 }} \n { % e ndif % } \n "
option_2 = NetworkOption ( name = " network_address_eth0 " , doc = " Network address " , properties = frozenset ( { " basic " , " mandatory " } ) , informations = { ' type ' : ' network ' } )
option_3 = NetmaskOption ( name = " netmask_address_eth0 " , doc = " Netmask address " , validators = [ Calculation ( func [ ' valid_with_jinja ' ] , Params ( ( ) , kwargs = { ' __internal_jinja ' : ParamValue ( " validators_rougail.netmask_address_eth0 " ) , ' __internal_type ' : ParamValue ( " string " ) , ' __internal_multi ' : ParamValue ( False ) , ' _.netmask_address_eth0 ' : ParamSelfOption ( whole = False ) , ' _.network_address_eth0 ' : ParamOption ( option_2 ) } ) ) ] , properties = frozenset ( { " basic " , " mandatory " } ) , informations = { ' type ' : ' netmask ' } )
optiondescription_1 = OptionDescription ( name = " rougail " , doc = " Rougail " , children = [ option_2 , option_3 ] , properties = frozenset ( { " basic " } ) )
option_0 = OptionDescription ( name = " baseoption " , doc = " baseoption " , children = [ optiondescription_1 ] )