first commit

This commit is contained in:
egarette@silique.fr 2025-03-02 16:18:24 +01:00
commit 4a1b9ef5a5
318 changed files with 3871 additions and 0 deletions

0
__init__.py Normal file
View file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

76
funcs/test.py Normal file
View file

@ -0,0 +1,76 @@
def trange(start, stop):
return list(range(start, stop))
def calc_val(*args, **kwargs):
if len(args) > 0:
return args[0]
def concat(*args, **kwargs):
pass
def calc_multi_condition(*args, **kwargs):
pass
def get_zone_name_bridge(*args, **kwargs):
pass
def get_devices(*args, **kwargs):
pass
def get_mount_point_device(*args, **kwargs):
pass
def valid_differ(*args, **kwargs):
pass
def valid_ipnetmask(*args, **kwargs):
pass
def valid_enum(*args, **kwargs):
pass
def valid_lower(*args, **kwargs):
pass
def list_files(*args, **kwargs):
# FIXME ?
return kwargs['default']
def calc_multi_val(*args, **kwargs):
return args[0]
def cdrom_minormajor(*args, **kwargs):
pass
def device_type(*args, **kwargs):
pass
def calc_list(*args, **kwargs):
return list(args)
def test_index(index):
return index
def return_no():
return 'no'
def return_yes():
return 'yes'

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,7 @@
from os import environ
environ['TIRAMISU_LOCALE'] = 'en'
from tiramisu import StrOption
class CustomOption(StrOption):
pass

196
src/rougail_tests/utils.py Normal file
View file

@ -0,0 +1,196 @@
from pathlib import Path
from rougail import RougailConfig
from .custom import CustomOption
def get_structures_list(excludes):
return [test for test in sorted((Path(__file__).parent.parent.parent / 'structures').iterdir()) if test.name not in excludes]
def get_funcs():
return [str(test) for test in sorted((Path(__file__).parent.parent.parent / 'funcs').iterdir()) if test.name.endswith('.py')]
def get_rougail_config(test_dir, namespace=False):
rougailconfig = RougailConfig
rougailconfig['functions_files'] = get_funcs()
dirs = [str(test_dir / 'rougail')]
subfolder = test_dir / 'rougail2'
if subfolder.is_dir():
dirs.append(str(subfolder))
rougailconfig['main_dictionaries'] = dirs
if namespace:
rougailconfig['main_namespace'] = 'Rougail'
if (test_dir / 'force_no_namespace').is_file():
return None
else:
rougailconfig['main_namespace'] = None
if (test_dir / 'force_namespace').is_file():
return None
extra_dictionaries = {}
extras = list(test_dir.iterdir())
extras.sort()
for extra in extras:
if extra.name in ['rougail', 'rougail2']:
continue
if extra.is_dir():
extra_dictionaries[extra.name] = [str(extra)]
if extra_dictionaries:
if not namespace:
return None
rougailconfig['extra_dictionaries'] = extra_dictionaries
else:
rougailconfig['extra_dictionaries'] = {}
rougailconfig['custom_types']['custom'] = CustomOption
# rougailconfig['tiramisu_cache'] = "cache.py"
return rougailconfig
def get_values_for_config(config, specify_dynamic_id=True, level="all"):
# level is "all" or "mandatories"
excludes = []
get_excludes(config.unrestraint, excludes)
config.property.read_only()
root_config = config.unrestraint
if level == 'all':
only = False
else:
only = True
values = {}
get_variables(root_config, root_config, values, only, excludes, specify_dynamic_id)
if not specify_dynamic_id:
for exclude in excludes:
_values = values
*s_exclude, name = exclude.split('.')
for _name in s_exclude:
if _name not in _values:
break
_values = _values[_name]
else:
if name in _values:
del _values[name]
return values
def get_excludes(config, excludes):
for option in config.list(uncalculated=True):
if option.isoptiondescription():
exclude = option.information.get('dynamic_variable',
None,
)
if exclude:
excludes.append(exclude)
get_excludes(option, excludes)
def get_value(variable, index, excludes):
if 'force_store_value' in variable.property.get():
return variable.value.get()
tests = variable.information.get('test', None)
if variable.path(uncalculated=True) in excludes and variable.value.get(uncalculated=True):
tests = variable.value.get()
elif tests:
tests = list(tests)
else:
if variable.type() == 'integer':
tests = [1, 2, 3]
elif variable.type() == 'float':
tests = [1.1, 2.2, 3.3]
elif variable.type() == 'port':
tests = ['80', '443']
elif variable.type() == 'boolean':
tests = [True]
elif variable.type() == 'domain name':
tests = ['domain1.lan', 'domain2.lan']
elif variable.type() == 'choice':
tests = variable.value.list()
elif variable.type() == 'network address':
if variable.extra('_cidr'):
tests = ['192.168.1.0/24', '10.0.0.0/24']
else:
tests = ['192.168.1.0', '10.0.0.0']
elif variable.type() == 'netmask address':
tests = ['255.255.255.0', '255.255.0.0']
elif variable.type() == 'IP':
if variable.extra('_cidr'):
tests = ['192.168.1.6/32', '10.0.10.0/24']
else:
tests = ['192.168.1.6', '10.0.10.10']
else:
tests = ['string1', 'string2', 'string3']
if not variable.ismulti():
tests = tests[0]
elif index is not None and variable.isfollower() and variable.issubmulti() is False:
tests = tests[index]
variable.value.set(tests)
# if tests == None:
# tests = ""
if index is not None and variable.isleader():
tests = tests[index]
return tests
def get_variables(root_config, config, values, only, excludes, specify_dynamic_id, *, index=None, leader_is_mandatory=False):
for idx, key in enumerate(config):
if key.isoptiondescription():
if key.isleadership():
value = []
leader = key.leader()
if only and not leader.value.mandatory():
leader_value = leader.value.get()
leader_is_mandatory = False
else:
leader_value = get_value(leader, None, excludes)
leader_is_mandatory = True
for idx_, val in enumerate(leader_value):
value.append({})
get_variables(root_config, key, value[-1], only, excludes, specify_dynamic_id, index=idx_, leader_is_mandatory=leader_is_mandatory)
if value:
values[key.name()] = value
else:
value = {}
get_variables(root_config, key, value, only, excludes, specify_dynamic_id)
if value:
values[key.name()] = value
else:
if only:
if key.isleader():
mandatory = leader_is_mandatory
else:
try:
mandatory = key.value.mandatory()
except:
mandatory = False
if not only or mandatory:
if key.index() is not None and index is not None and index != key.index():
continue
value = get_value(key, index, excludes)
if specify_dynamic_id or key.path(uncalculated=True) not in excludes:
values[key.name()] = value
def config_to_dict(parent, key_is_option=False):
for option, value in parent.items():
if option.isoptiondescription():
if not key_is_option and option.isleadership():
ret = []
for idx, datas in enumerate(config_to_dict(value, key_is_option=True)):
sub_option, sub_value = datas
if not idx:
sub_option = sub_option.path()
key = sub_option
for val in sub_value:
ret.append({sub_option: val})
else:
index = sub_option.index()
sub_option = sub_option.path()
ret[index][sub_option] = sub_value
yield key, ret
else:
yield from config_to_dict(value, key_is_option)
elif key_is_option:
yield option, value
else:
yield option.path(), value

View file

View file

@ -0,0 +1,3 @@
---
_version: '1.1'
version: # a variable

View file

@ -0,0 +1,3 @@
---
version: '1.0'
empty:

View file

@ -0,0 +1,10 @@
---
version: 1.1
var1: "no" # a first variable
var2:
description: a second variable
multi: true
default:
jinja: |
{{ _.var1 }}
description: the value of var1

View file

@ -0,0 +1,15 @@
---
version: 1.1
var1: # a first variable
- 'no'
- 'yes'
- maybe
var2:
description: a second variable
multi: true
default:
jinja: |
{% for val in _.var1 %}
{{ val }}
{% endfor %}
description: the value of _.var1

View file

@ -0,0 +1,15 @@
---
version: 1.1
var1:
description: a first variable
multi: true
type: domainname
params:
allow_ip: true
var2:
description: a second variable
default:
type: variable
variable: _.var1

View file

@ -0,0 +1,4 @@
---
version: '1.0'
var1:
description: a variable

View file

@ -0,0 +1,4 @@
---
version: "1.0"
var2:
description: a variable

View file

@ -0,0 +1,5 @@
---
version: '1.0'
without_type:
description: a variable
default: non

View file

@ -0,0 +1,18 @@
---
version: '1.1'
var1: true # the first variable
var2:
description: the second variable
default: true
var3:
description: the third variable
type: boolean
default: true
var4: false # the forth variable
var5:
description: the fifth variable
default: false
var6:
description: the sixth variable
type: boolean
default: false

View file

@ -0,0 +1,6 @@
---
version: '1.1'
variable:
description: a variable
type: boolean
mandatory: false

View file

@ -0,0 +1,42 @@
---
version: '1.1'
var1:
description: the first variable
choices:
- a
- b
- c
var2:
description: the second variable
choices:
- a
- b
- c
var3:
description: the third variable
choices:
- a
- b
- c
mandatory: false
var4:
description: the forth variable
choices:
- null
- b
- c
mandatory: false
var5:
description: the fifth variable
choices:
- a
- b
- c
default: a
var6:
description: the sixth variable
choices:
- 1
- 2
- 3
default: 1

View file

@ -0,0 +1,12 @@
---
version: 1.1
var:
description: a variable
default: 9
choices:
jinja: |
{% for n in trange(0, 10) %}
{{ n }}
{% endfor %}
return_type: 'number'
description: choices is 0 to 9

View file

@ -0,0 +1,11 @@
---
version: '1.1'
var1: # a second variable
- a
- b
- c
var2:
description: a first variable
default: a
choices:
variable: _.var1

View file

@ -0,0 +1,9 @@
---
version: '1.1'
custom1:
description: the first variable
type: custom
custom2:
description: the seconf variable
type: custom
default: value

View file

@ -0,0 +1,6 @@
---
version: '1.1'
variable:
description: a domain name variable
type: domainname
default: my.domain.name

View file

@ -0,0 +1,8 @@
---
version: '1.1'
variable:
description: a domain name variable
type: domainname
default: my.domain.name
params:
allow_ip: true

View file

@ -0,0 +1,18 @@
---
version: '1.1'
var1: 0.0 # the first variable
var2:
description: the second variable
default: 0.0
var3:
description: the third variable
type: float
default: 0.0
var4: 10.1 # the forth variable
var5:
description: the fifth variable
default: 10.1
var6:
description: the sixth variable
type: float
default: 10.1

View file

@ -0,0 +1,18 @@
---
version: '1.1'
var1: 0 # the first variable
var2:
description: the second variable
default: 0
var3:
description: the third variable
type: number
default: 0
var4: 10 # this forth variable
var5:
description: the fifth variable
default: 10
var6:
description: the sixth variable
type: number
default: 10

View file

@ -0,0 +1,13 @@
---
version: '1.1'
variable1:
description: a port variable
type: port
variable2:
description: a port variable with default value
type: port
default: '8080'
variable3:
description: a port variable with integer default value
type: port
default: 8080

View file

@ -0,0 +1,9 @@
---
version: '1.1'
var:
description: a first variable
regexp: "^#(?:[0-9a-f]{3}){1,2}$"
default: "#a1a1a1"
test:
- "#b1b1b1"
- "#b2b2b2"

View file

@ -0,0 +1,9 @@
---
version: '1.1'
secret1:
description: the first variable
type: secret
secret2:
description: the second variable
type: secret
default: value

View file

@ -0,0 +1,17 @@
---
version: '1.1'
var1: # the first variable
var2:
description: the second variable
default:
var3:
description: the third variable
type: string
var4: value # the forth variable
var5:
description: the fifth variable
default: value
var6:
description: the sixth variable
type: string
default: value

View file

@ -0,0 +1,10 @@
---
version: '1.0'
var:
type: choice
description: A choice
default: quote'
choices:
- quote'
- quote"
- quote"'

View file

@ -0,0 +1,8 @@
---
version: '1.0'
var1:
description: the first variable
help: message with '
var2:
description: the second variable
help: message with "

View file

@ -0,0 +1,5 @@
---
version: '1.1'
variable:
description: a variable
default: quote"

View file

@ -0,0 +1,5 @@
---
version: '1.1'
variable:
description: a variable
default: quote'"

View file

@ -0,0 +1,6 @@
---
version: '1.1'
variable:
description: a variable
default: quote\"\'

View file

@ -0,0 +1,5 @@
---
version: '1.0'
variable:
description: a variable
default: quote'

View file

@ -0,0 +1,12 @@
---
version: '1.1'
variable:
description: a variable
default:
jinja: |
{{test_information }}
params:
test_information:
type: information
information: test_information
description: get information test_information

View file

@ -0,0 +1,40 @@
---
version: '1.1'
var1:
description: the first variable
test:
- test
var2:
description: the second variable
test:
- test
default: value
var3:
description: the third variable
test:
- test1
- test2
var4:
description: the forth variable
test:
- null
- test1
- test2
mandatory: false
var5:
description: the fifth variable
type: boolean
test:
- false
var6:
description: the sixth variable
multi: true
test:
- test1
- test2

View file

@ -0,0 +1,17 @@
---
version: '1.1'
variable1:
description: a first variable
type: choice
multi: true
choices:
- val1
- val2
variable2:
description: a second variable
type: choice
multi: true
mandatory: false
choices:
- val1
- val2

View file

@ -0,0 +1,11 @@
---
version: '1.1'
source_variable_1: val1 # the first source variable
source_variable_2: val2 # the second source variable
my_variable:
description: a variable
type: choice
choices:
- variable: _.source_variable_1
- variable: _.source_variable_2
default: val1

View file

@ -0,0 +1,14 @@
---
version: '1.1'
variable:
description: a variable
default:
jinja: |
{{ param1 }}_{{ param2 }}_{{ param3 }}_{{ param4 }}
params:
param1: string
param2: 1
param3: true
param4: null
description: concat all parameters

View file

@ -0,0 +1,12 @@
---
version: '1.1'
var:
description: a variable
default:
jinja: '{{ information }}'
params:
information:
type: information
information: test_information
variable: _.var
description: returns the information

View file

@ -0,0 +1,13 @@
---
version: '1.1'
var1: # a first variable
var2:
description: a second variable
default:
jinja: |
{{ information }}
params:
information:
type: information
information: test_information
variable: _.var1

View file

@ -0,0 +1,11 @@
---
version: 1.1
my_variable:
default: val1
my_calculated_variable:
multi: true
default:
- variable: _.my_variable
optional: true
- variable: _.my_variable_unexists
optional: true

View file

@ -0,0 +1,11 @@
---
version: 1.1
my_variable:
default: val1
my_calculated_variable:
multi: true
default:
- variable: _.my_variable_unexists
optional: true
- variable: _.my_variable
optional: true

View file

@ -0,0 +1,7 @@
---
version: 1.1
my_calculated_variable:
multi: true
default:
variable: _.my_variable
optional: true

View file

@ -0,0 +1,12 @@
---
version: 1.1
my_variable:
multi: true
default:
- val1
- val2
my_calculated_variable:
multi: true
default:
variable: _.my_variable
optional: true

View file

@ -0,0 +1,28 @@
---
version: '1.1'
var1:
description: a first variable
default:
jinja: '{% if var2 is defined %}
{{ var2 }}
{% elif var3 is defined %}
{{ var3 }}
{% elif var4 is defined %}
{{ var4 }}
{% else %}
{{ _.var2 }}
{% endif %}
'
params:
var2:
variable: _.var2
optional: true
var3:
variable: _.var3
optional: true
var4:
variable: _.unknown_family.var
optional: true
description: returns a value
mandatory: false
var2: "no" # a second variable

View file

@ -0,0 +1,9 @@
---
version: '1.1'
var1: # a first variable
var2:
description: a second variable
default:
type: information
information: test_information
variable: _.var1

View file

@ -0,0 +1,9 @@
---
version: '1.1'
var1: # a first variable
var2:
description: a second variable
default:
# type: information
information: test_information
variable: _.var1

View file

@ -0,0 +1,12 @@
---
version: '1.1'
var:
description: a variable
default: 9
choices:
jinja: |+
{% for item in trange(0, 10) %}
{{ item }}
{%- endfor %}
return_type: number
description: choice for 0 to 9

View file

@ -0,0 +1,7 @@
---
version: '1.1'
variable:
description: a variable
default:
jinja: 'no'
description: return no

View file

View file

@ -0,0 +1,3 @@
---
version: '1.1'
variable: rougail # a variable

View file

@ -0,0 +1,21 @@
---
version: '1.1'
variable1:
description: a first variable
default:
variable: rougail.variable
variable2:
description: a second variable
default:
jinja: |
{{ rougail.variable }}
description: copy the value of rougail.variable
variable3:
description: a third variable
default:
jinja: |
{{ variable }}
params:
variable:
variable: rougail.variable
description: copy the value of rougail.variable

View file

@ -0,0 +1,3 @@
---
version: '1.1'
variable: value # a variable

View file

@ -0,0 +1,5 @@
---
version: '1.1'
variable:
description: a variable
default: value in extra

View file

@ -0,0 +1,6 @@
---
version: '1.1'
variable:
description: a variable
default:
variable: extra.variable

View file

@ -0,0 +1,36 @@
---
version: '1.1'
var1: # the first variable
- true
var2:
description: the second variable
default:
- true
var3:
description: the third variable
type: boolean
default:
- true
var4: # the forth variable
- false
var5:
description: the fifth variable
default:
- false
var6:
description: the sixth variable
type: boolean
default:
- false
var7:
description: the seventh variable
multi: true
default:
- true
var8:
description: the eighth variable
type: boolean
multi: true
default:
- true

View file

@ -0,0 +1,11 @@
---
version: '1.1'
custom1:
description: a first custom variable
type: custom
multi: true
custom2:
description: a second custom variable
type: custom
default:
- value

View file

@ -0,0 +1,36 @@
---
version: '1.1'
var1: # the first variable
- 0.0
var2:
description: the second variable
default:
- 0.0
var3:
description: the third variable
type: float
default:
- 0.0
var4: # the forth variable
- 10.1
var5:
description: the fifth variable
default:
- 10.1
var6:
description: the sixth variable
type: float
default:
- 10.1
var7:
description: the seventh variable
multi: true
default:
- 0.0
var8:
description: the eighth variable
type: float
multi: true
default:
- 0.0

View file

@ -0,0 +1,36 @@
---
version: '1.1'
var1: # the first variable
- 0
var2:
description: the second variable
default:
- 0
var3:
description: the third variable
type: number
default:
- 0
var4: # the forth variable
- 10
var5:
description: the fifth variable
default:
- 10
var6:
description: the sixth variable
type: number
default:
- 10
var7:
description: the seventh variable
multi: true
default:
- 0
var8:
description: the eighth variable
type: number
multi: true
default:
- 0

View file

@ -0,0 +1,8 @@
---
version: '1.1'
var1:
description: the second variable
empty: false
default:
- 'value'
- null

View file

@ -0,0 +1,33 @@
---
version: '1.1'
var1: [] # the first variable
var2:
description: the second variable
default: []
var3:
description: the third variable
type: string
multi: true
var4: # the forth variable
- value
var5:
description: the fifth variable
default:
- value
var6:
description: the sixth variable
type: string
default:
- value
var7:
description: the seventh variable
multi: true
default:
- value
var8:
description: the eighth variable
type: string
multi: true
default:
- value

View file

@ -0,0 +1,6 @@
---
version: '1.1'
variable:
description: a variable
default:
- quote"

View file

@ -0,0 +1,6 @@
---
version: '1.1'
variable:
description: a variable
default:
- quote'"

View file

@ -0,0 +1,6 @@
---
version: '1.1'
variable:
description: a variable
default:
- quote'

View file

@ -0,0 +1,15 @@
---
version: '1.1'
variable:
description: a variable
multi: true
default:
jinja: |
{% for info in test_information %}
{{ info }}
{% endfor %}
params:
test_information:
type: information
information: test_information_list
description: get information test_information

View file

@ -0,0 +1,10 @@
---
version: '1.1'
variable1: # a first variable
- a
- b
- c
variable2:
description: a second variable
choices:
variable: _.variable1

View file

@ -0,0 +1,8 @@
---
version: '1.1'
int:
description: A limited number
default: 10
params:
min_number: 0
max_number: 100

View file

@ -0,0 +1,6 @@
---
version: 1.1
variable:
description: an auto save variable
auto_save: true
default: "no"

View file

@ -0,0 +1,8 @@
---
version: 1.1
var1: "no" # a first variable
var2:
description: a second variable
auto_save: true
default:
variable: _.var1

View file

@ -0,0 +1,15 @@
---
version: '1.1'
var1: "no" # a first variable
var2:
description: a second variable
auto_save: true
hidden:
jinja: |
{% if _.var1 == "yes" %}
_.var1 is yes
{% endif %}
description: only if the variable var1 has value "yes"
default:
jinja: 'yes'
description: the value is always yes

View file

@ -0,0 +1,8 @@
---
version: '1.1'
var:
description: autosave variable
auto_save: true
hidden: true
default: 'yes'
mandatory: false

View file

@ -0,0 +1,20 @@
---
version: 1.1
var1:
description: a first variable
default: value
var2:
description: a second variable
disabled:
variable: _.var1
when: value
var3:
description: a third variable
default:
jinja: |
{% if _.var1 == 'value' or _.var2 == 'blah' %}
value
{% endif %}

View file

@ -0,0 +1,20 @@
---
version: 1.1
var1:
description: a first variable
default: value
var2:
description: a second variable
disabled:
variable: _.var1
when: value
var3:
description: a third variable
default:
jinja: |
{% if _.var2 is propertyerror %}
value
{% endif %}

View file

@ -0,0 +1,19 @@
---
version: '1.1'
condition: "no" # a conditional variable
variable1:
description: a first variable
disabled:
jinja: |
{% if _.condition == "yes" %}
condition is yes
{% endif %}
description: if condition is egal to "yes"
variable2:
description: a second variable
disabled:
jinja: |
{% if _.condition == "yes" %}
condition is yes
{% endif %}
description: if condition is egal to "yes"

View file

@ -0,0 +1,30 @@
---
version: '1.1'
condition: "no" # a condition
var1:
description: a first variable
disabled:
jinja: |
{% if _.condition == "yes" %}
condition is yes
{% endif %}
description: if condition is yes
default:
jinja: |
{{ _.condition }}
description: the value of condition
var2:
description: a second variable
disabled:
jinja: |
{% if rougail.condition == "yes" %}
condition is yes
{% endif %}
description: if condition is yes
default:
jinja: |
{{ rougail.condition }}
description: the value of condition

View file

@ -0,0 +1,21 @@
---
version: '1.1'
condition: "no" # a conditional variable
variable1:
description: a first variable
multi: true
disabled:
jinja: |
{% if _.condition == "yes" %}
condition is yes
{% endif %}
description: if condition is egal to "yes"
variable2:
description: a second variable
multi: true
disabled:
jinja: |
{% if _.condition == "yes" %}
condition is yes
{% endif %}
description: if condition is egal to "yes"

View file

@ -0,0 +1,33 @@
---
version: '1.1'
condition: "no" # a condition
var1:
description: a first variable
hidden:
jinja: |
{% if unknown is not defined %}
unknown is undefined
{% elif unknown == "no" %}
unknown is no
{% endif %}
params:
unknown:
variable: _.unknown
optional: true
description: calculation from an unknown variable
mandatory: false
var2:
description: a second variable
hidden:
jinja: |
{% if condition is not defined %}
condition is undefined
{% elif condition == "no" %}
condition is no
{% endif %}
params:
condition:
variable: _.condition
optional: true
description: calculation from an condition variable
mandatory: false

View file

@ -0,0 +1,7 @@
---
version: '1.1'
condition: false # a condition
variable:
description: a variable
disabled:
variable: _.condition

View file

@ -0,0 +1,7 @@
---
version: '1.1'
condition: true # a condition
variable:
description: a variable
disabled:
variable: _.condition

View file

@ -0,0 +1,8 @@
---
version: '1.1'
condition: "yes" # a condition
variable:
description: a variable
disabled:
variable: _.condition
when: "yes"

View file

@ -0,0 +1,8 @@
---
version: '1.1'
condition: "yes" # a condition
variable:
description: a variable
disabled:
variable: _.condition
when_not: "yes"

View file

@ -0,0 +1,8 @@
---
version: '1.1'
condition: false # a condition
variable:
description: a variable
multi: true
disabled:
variable: _.condition

View file

@ -0,0 +1,21 @@
---
version: '1.1'
condition: 'no' # the condition
var1:
description: a first variable
default: "no"
hidden:
jinja: |
{% if _.condition == "yes" %}
condition is yes
{% endif %}
description: if condition is yes
var2:
description: a second variable
default: "no"
hidden:
jinja: |
{% if rougail.condition == "yes" %}
condition is yes
{% endif %}
description: if condition is yes

View file

@ -0,0 +1,27 @@
---
version: '1.1'
condition: "no" # a condition
var1:
description: a first variable
hidden:
jinja: |
{% if _.condition != "yes" %}
condition is yes
{% endif %}
description: if condition is yes
default:
jinja: |
{{ _.condition }}
description: the value of condition
var2:
description: a second variable
hidden:
jinja: |
{% if rougail.condition != "yes" %}
condition is yes
{% endif %}
description: if condition is yes
default:
jinja: |
{{ rougail.condition }}
description: the value of condition

View file

@ -0,0 +1,27 @@
---
version: '1.1'
condition: "no" # a condition
var1:
description: a first variable
hidden:
jinja: |
{% if _.condition == "yes" %}
condition is yes
{% endif %}
description: if condition is yes
default:
jinja: |
{{ _.condition }}
description: returns the condition value
var2:
description: a second variable
hidden:
jinja: |
{% if rougail.condition == "yes" %}
condition is yes
{% endif %}
description: if condition is yes
default:
jinja: |
{{ rougail.condition }}
description: returns the condition value

Some files were not shown because too many files have changed in this diff Show more