add manage service
This commit is contained in:
parent
bc25216c27
commit
41620cc92e
6 changed files with 36 additions and 1 deletions
|
@ -65,7 +65,9 @@ class ServiceAnnotator:
|
||||||
self.objectspace.space.services.doc = 'services'
|
self.objectspace.space.services.doc = 'services'
|
||||||
self.objectspace.space.services.path = 'services'
|
self.objectspace.space.services.path = 'services'
|
||||||
for service_name, service in self.objectspace.space.services.service.items():
|
for service_name, service in self.objectspace.space.services.service.items():
|
||||||
|
if not service.manage:
|
||||||
service.information = self.objectspace.information(service.xmlfiles)
|
service.information = self.objectspace.information(service.xmlfiles)
|
||||||
|
service.information.manage = service.manage
|
||||||
for elttype, values in dict(vars(service)).items():
|
for elttype, values in dict(vars(service)).items():
|
||||||
if not isinstance(values, (dict, list)) or elttype in ERASED_ATTRIBUTES:
|
if not isinstance(values, (dict, list)) or elttype in ERASED_ATTRIBUTES:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
|
|
||||||
<!ELEMENT service ((port*|ip*|file*|override*)*)>
|
<!ELEMENT service ((port*|ip*|file*|override*)*)>
|
||||||
<!ATTLIST service name CDATA #REQUIRED>
|
<!ATTLIST service name CDATA #REQUIRED>
|
||||||
|
<!ATTLIST service manage (True|False) "True">
|
||||||
|
|
||||||
<!ELEMENT port (#PCDATA)>
|
<!ELEMENT port (#PCDATA)>
|
||||||
<!ATTLIST port port_type (port|variable) "port">
|
<!ATTLIST port port_type (port|variable) "port">
|
||||||
|
|
12
tests/dictionaries/70service_not_managed/00-base.xml
Normal file
12
tests/dictionaries/70service_not_managed/00-base.xml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<rougail version="0.9">
|
||||||
|
<services>
|
||||||
|
<service name='test' manage="False">
|
||||||
|
</service>
|
||||||
|
</services>
|
||||||
|
<variables>
|
||||||
|
<variable name='var' type='string'>
|
||||||
|
<value>mailname</value>
|
||||||
|
</variable>
|
||||||
|
</variables>
|
||||||
|
</rougail>
|
0
tests/dictionaries/70service_not_managed/__init__.py
Normal file
0
tests/dictionaries/70service_not_managed/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"rougail.var": "mailname"}
|
19
tests/dictionaries/70service_not_managed/tiramisu/base.py
Normal file
19
tests/dictionaries/70service_not_managed/tiramisu/base.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
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="var", doc="var", default="mailname", properties=frozenset({"mandatory", "normal"}))
|
||||||
|
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||||
|
option_4 = OptionDescription(name="test", doc="test", children=[])
|
||||||
|
option_4.impl_set_information('manage', False)
|
||||||
|
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])
|
Loading…
Reference in a new issue