manage
This commit is contained in:
@ -36,6 +36,7 @@ ERASED_ATTRIBUTES = ('redefine', 'exists', 'optional', 'remove_check', 'namespac
|
||||
'remove_condition', 'path', 'instance_mode', 'index',
|
||||
'level', 'remove_fill', 'xmlfiles', 'type', 'reflector_name',
|
||||
'reflector_object',)
|
||||
ALLOW_ATTRIBUT_NOT_MANAGE = ['file']
|
||||
|
||||
|
||||
class ServiceAnnotator:
|
||||
@ -71,7 +72,13 @@ class ServiceAnnotator:
|
||||
for elttype, values in dict(vars(service)).items():
|
||||
if not isinstance(values, (dict, list)) or elttype in ERASED_ATTRIBUTES:
|
||||
continue
|
||||
eltname = elttype + 's'
|
||||
if not service.manage and elttype not in ALLOW_ATTRIBUT_NOT_MANAGE:
|
||||
msg = _(f'unmanage service cannot have "{elttype}"')
|
||||
raise DictConsistencyError(msg, 66, service.xmlfiles)
|
||||
if elttype != 'ip':
|
||||
eltname = elttype + 's'
|
||||
else:
|
||||
eltname = elttype
|
||||
path = '.'.join(['services', normalize_family(service_name), eltname])
|
||||
family = self._gen_family(eltname,
|
||||
path,
|
||||
|
Reference in New Issue
Block a user