Compare commits
3 Commits
pkg/dev/ri
...
d7a1a52ebb
Author | SHA1 | Date | |
---|---|---|---|
d7a1a52ebb | |||
d3008dc217 | |||
a87485abd2 |
@ -29,6 +29,16 @@ Un service non géré ne peut conteneur que des fichiers.
|
|||||||
|
|
||||||
## Désactiver la génération d'un service
|
## Désactiver la génération d'un service
|
||||||
|
|
||||||
|
Il est possible de désactiver un service. Pour cela il faut rajouter l'attribut "disabled" à True :
|
||||||
|
|
||||||
|
```
|
||||||
|
<services>
|
||||||
|
<service name="test" disabled="True"/>
|
||||||
|
</services>
|
||||||
|
```
|
||||||
|
|
||||||
|
Dans ce cas, tous les services et les éléments qu'il compose ([fichier](file.md), ...) seront désactivés.
|
||||||
|
|
||||||
Il est possible de définir une [condition](../condition/README.md) de type "disabled_if_in" ou "disabled_if_not_in" sur une balise service :
|
Il est possible de définir une [condition](../condition/README.md) de type "disabled_if_in" ou "disabled_if_not_in" sur une balise service :
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -76,10 +76,11 @@ class Annotator:
|
|||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
'activate',
|
'activate',
|
||||||
True,
|
not service.disabled,
|
||||||
service,
|
service,
|
||||||
'.'.join(['services', normalize_family(service_name), 'activate']),
|
'.'.join(['services', normalize_family(service_name), 'activate']),
|
||||||
)
|
)
|
||||||
|
service.disabled = None
|
||||||
for elttype, values in dict(vars(service)).items():
|
for elttype, values in dict(vars(service)).items():
|
||||||
if elttype == 'servicelist':
|
if elttype == 'servicelist':
|
||||||
self.objectspace.list_conditions.setdefault('servicelist',
|
self.objectspace.list_conditions.setdefault('servicelist',
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
<!ATTLIST service name CDATA #REQUIRED>
|
<!ATTLIST service name CDATA #REQUIRED>
|
||||||
<!ATTLIST service manage (True|False) "True">
|
<!ATTLIST service manage (True|False) "True">
|
||||||
<!ATTLIST service servicelist CDATA #IMPLIED>
|
<!ATTLIST service servicelist CDATA #IMPLIED>
|
||||||
|
<!ATTLIST service disabled (True|False) "False">
|
||||||
|
|
||||||
<!ELEMENT ip (#PCDATA)>
|
<!ELEMENT ip (#PCDATA)>
|
||||||
<!ATTLIST ip iplist CDATA #IMPLIED>
|
<!ATTLIST ip iplist CDATA #IMPLIED>
|
||||||
|
@ -251,7 +251,11 @@ class Common:
|
|||||||
if param.type == 'variable':
|
if param.type == 'variable':
|
||||||
return self.build_option_param(param)
|
return self.build_option_param(param)
|
||||||
if param.type == 'information':
|
if param.type == 'information':
|
||||||
return f'ParamInformation("{param.text}", None)'
|
if hasattr(self.elt, 'multi') and self.elt.multi:
|
||||||
|
default = []
|
||||||
|
else:
|
||||||
|
default = None
|
||||||
|
return f'ParamInformation("{param.text}", {default})'
|
||||||
if param.type == 'target_information':
|
if param.type == 'target_information':
|
||||||
return f'ParamSelfInformation("{param.text}", None)'
|
return f'ParamSelfInformation("{param.text}", None)'
|
||||||
if param.type == 'suffix':
|
if param.type == 'suffix':
|
||||||
|
14
tests/dictionaries/10fill_information_multi/00-base.xml
Normal file
14
tests/dictionaries/10fill_information_multi/00-base.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<rougail version="0.10">
|
||||||
|
<variables>
|
||||||
|
<family name="general">
|
||||||
|
<variable name="mode_conteneur_actif" type="string" description="No change" multi="True"/>
|
||||||
|
</family>
|
||||||
|
</variables>
|
||||||
|
<constraints>
|
||||||
|
<fill name="calc_val">
|
||||||
|
<param type="information">test_information</param>
|
||||||
|
<target>mode_conteneur_actif</target>
|
||||||
|
</fill>
|
||||||
|
</constraints>
|
||||||
|
</rougail>
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"rougail.general.mode_conteneur_actif": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": [
|
||||||
|
"value"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"rougail.general.mode_conteneur_actif": [
|
||||||
|
"value"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"rougail.general.mode_conteneur_actif": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": [
|
||||||
|
"value"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
17
tests/dictionaries/10fill_information_multi/tiramisu/base.py
Normal file
17
tests/dictionaries/10fill_information_multi/tiramisu/base.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
from importlib.machinery import SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader, module_from_spec
|
||||||
|
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
||||||
|
spec = spec_from_loader(loader.name, loader)
|
||||||
|
func = module_from_spec(spec)
|
||||||
|
loader.exec_module(func)
|
||||||
|
for key, value in dict(locals()).items():
|
||||||
|
if key != ['SourceFileLoader', 'func']:
|
||||||
|
setattr(func, key, value)
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", multi=True, default=[Calculation(func.calc_val, Params((ParamInformation("test_information", []))))], properties=frozenset({"normal"}))
|
||||||
|
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
||||||
|
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"rougail.general.varname": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": [
|
||||||
|
"val1",
|
||||||
|
"val2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rougail.dynval1.vardynval1": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"rougail.dynval1.leadershipval1.leaderval1": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": []
|
||||||
|
},
|
||||||
|
"rougail.dynval1.leadershipval1.follower1val1": {
|
||||||
|
"owner": [],
|
||||||
|
"value": []
|
||||||
|
},
|
||||||
|
"rougail.dynval1.leadershipval1.follower2val1": {
|
||||||
|
"owner": [],
|
||||||
|
"value": []
|
||||||
|
},
|
||||||
|
"rougail.dynval2.vardynval2": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"rougail.dynval2.leadershipval2.leaderval2": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": []
|
||||||
|
},
|
||||||
|
"rougail.dynval2.leadershipval2.follower1val2": {
|
||||||
|
"owner": [],
|
||||||
|
"value": []
|
||||||
|
},
|
||||||
|
"rougail.dynval2.leadershipval2.follower2val2": {
|
||||||
|
"owner": [],
|
||||||
|
"value": []
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"rougail.general.varname": [
|
||||||
|
"val1",
|
||||||
|
"val2"
|
||||||
|
],
|
||||||
|
"rougail.dynval1.vardynval1": null,
|
||||||
|
"rougail.dynval1.leadershipval1.leaderval1": [],
|
||||||
|
"rougail.dynval2.vardynval2": null,
|
||||||
|
"rougail.dynval2.leadershipval2.leaderval2": []
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"rougail.general.varname": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": [
|
||||||
|
"val1",
|
||||||
|
"val2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rougail.dynval1.vardynval1": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"rougail.dynval1.leadershipval1.leaderval1": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": []
|
||||||
|
},
|
||||||
|
"rougail.dynval1.leadershipval1.follower1val1": {
|
||||||
|
"owner": [],
|
||||||
|
"value": []
|
||||||
|
},
|
||||||
|
"rougail.dynval1.leadershipval1.follower2val1": {
|
||||||
|
"owner": [],
|
||||||
|
"value": []
|
||||||
|
},
|
||||||
|
"rougail.dynval2.vardynval2": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"rougail.dynval2.leadershipval2.leaderval2": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": []
|
||||||
|
},
|
||||||
|
"rougail.dynval2.leadershipval2.follower1val2": {
|
||||||
|
"owner": [],
|
||||||
|
"value": []
|
||||||
|
},
|
||||||
|
"rougail.dynval2.leadershipval2.follower2val2": {
|
||||||
|
"owner": [],
|
||||||
|
"value": []
|
||||||
|
}
|
||||||
|
}
|
12
tests/dictionaries/70service_disabled/00-base.xml
Normal file
12
tests/dictionaries/70service_disabled/00-base.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<rougail version="0.10">
|
||||||
|
<services>
|
||||||
|
<service name="test" disabled="True">
|
||||||
|
</service>
|
||||||
|
</services>
|
||||||
|
<variables>
|
||||||
|
<variable name="condition">
|
||||||
|
<value>no</value>
|
||||||
|
</variable>
|
||||||
|
</variables>
|
||||||
|
</rougail>
|
0
tests/dictionaries/70service_disabled/__init__.py
Normal file
0
tests/dictionaries/70service_disabled/__init__.py
Normal file
14
tests/dictionaries/70service_disabled/makedict/after.json
Normal file
14
tests/dictionaries/70service_disabled/makedict/after.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"rougail.condition": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": "no"
|
||||||
|
},
|
||||||
|
"services.test.activate": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
"services.test.manage": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": true
|
||||||
|
}
|
||||||
|
}
|
5
tests/dictionaries/70service_disabled/makedict/base.json
Normal file
5
tests/dictionaries/70service_disabled/makedict/base.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"rougail.condition": "no",
|
||||||
|
"services.test.activate": false,
|
||||||
|
"services.test.manage": true
|
||||||
|
}
|
14
tests/dictionaries/70service_disabled/makedict/before.json
Normal file
14
tests/dictionaries/70service_disabled/makedict/before.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"rougail.condition": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": "no"
|
||||||
|
},
|
||||||
|
"services.test.activate": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
"services.test.manage": {
|
||||||
|
"owner": "default",
|
||||||
|
"value": true
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
/dev/null
|
20
tests/dictionaries/70service_disabled/tiramisu/base.py
Normal file
20
tests/dictionaries/70service_disabled/tiramisu/base.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
from importlib.machinery import SourceFileLoader
|
||||||
|
from importlib.util import spec_from_loader, module_from_spec
|
||||||
|
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
||||||
|
spec = spec_from_loader(loader.name, loader)
|
||||||
|
func = module_from_spec(spec)
|
||||||
|
loader.exec_module(func)
|
||||||
|
for key, value in dict(locals()).items():
|
||||||
|
if key != ['SourceFileLoader', 'func']:
|
||||||
|
setattr(func, key, value)
|
||||||
|
try:
|
||||||
|
from tiramisu3 import *
|
||||||
|
except:
|
||||||
|
from tiramisu import *
|
||||||
|
option_2 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||||
|
option_5 = BoolOption(name="activate", doc="activate", default=False)
|
||||||
|
option_6 = BoolOption(name="manage", doc="manage", default=True)
|
||||||
|
option_4 = OptionDescription(name="test", doc="test", children=[option_5, option_6])
|
||||||
|
option_3 = OptionDescription(name="services", doc="services", children=[option_4], properties=frozenset({"hidden"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_3])
|
Reference in New Issue
Block a user