Compare commits

..

No commits in common. "590283ef2504f5af5d2cef34b0238b71a4729221" and "7ecf861459ca4c24f23c53c167b7b068e5e07108" have entirely different histories.

302 changed files with 1856 additions and 1622 deletions

View File

@ -4,11 +4,13 @@ from copy import copy
from collections import OrderedDict
from os.path import join, basename
from ast import literal_eval
import sys
import imp
from .i18n import _
from .utils import normalize_family
from .config import VIRTBASE, VIRTROOT, VIRTMASTER, templatedir
from .error import CreoleDictConsistencyError
from .xmlreflector import HIGH_COMPATIBILITY
@ -110,7 +112,7 @@ class ContainerAnnotator:
family.name = 'container{}'.format(idx)
family.doc = container.name
family.family = OrderedDict()
self.convert_container_to_family(family.name, family.family, container)
self.convert_container_to_family(family.family, container)
setattr(self.space.containers, family.name, family)
del self.space.containers.container
else:
@ -145,7 +147,7 @@ class ContainerAnnotator:
old_container[name] = new_elt
del self.space.containers.all
def convert_container_to_family(self, container_name, container_family, container):
def convert_container_to_family(self, container_family, container):
# tranform container object to family object
# add services, service_accesses, ...
for elttype in self.objectspace.container_elt_attr_list:
@ -166,7 +168,7 @@ class ContainerAnnotator:
family.family = self.make_group_from_elts(elttype,
values,
key_type,
'containers.{}.{}'.format(container_name, family.name),
'containers.{}'.format(family.name),
True)
family.mode = None
container_family[family.name] = family
@ -217,7 +219,7 @@ class ContainerAnnotator:
self.paths.append('variable', path, 'containers', 'containers', variable)
return variable
def _make_disknod_auto(self, type_, index, variable, container_path):
def _make_disknod_auto(self, type_, index, variable):
if not hasattr(self.space.constraints, 'auto'):
self.space.constraints.auto = []
auto = self.objectspace.auto()
@ -231,12 +233,12 @@ class ContainerAnnotator:
auto.param = [param1, param2]
auto.name = 'cdrom_minormajor'
family = 'disknod{}'.format(index)
auto.target = '{}.{}.{}'.format(container_path, family, type_)
auto.target = 'containers.disknods.{}.{}'.format(family, type_)
if not hasattr(self.space, 'constraints'):
self.space.constraints = self.objectspace.constraints()
self.space.constraints.auto.append(auto)
def _make_disknod_type(self, index, variable, container_path):
def _make_disknod_type(self, index, variable):
auto = self.objectspace.auto()
self.objectspace.index += 1
auto.index = self.objectspace.index
@ -246,7 +248,7 @@ class ContainerAnnotator:
auto.param = [param]
auto.name = 'device_type'
family = 'disknod{}'.format(index)
auto.target = '{}.{}.type'.format(container_path, family)
auto.target = 'containers.disknods.{}.type'.format(family)
if not hasattr(self.space, 'constraints'):
self.space.constraints = self.objectspace.constraints()
if not hasattr(self.space.constraints, 'auto'):
@ -254,17 +256,17 @@ class ContainerAnnotator:
self.space.constraints.auto.append(auto)
def _update_disknod(self, disknod, index, container_path):
def _update_disknod(self, disknod, index):
disknod.major = None
disknod.minor = None
disknod.type = None
self._make_disknod_auto('minor', index, disknod, container_path)
self._make_disknod_auto('major', index, disknod, container_path)
self._make_disknod_type(index, disknod, container_path)
self._make_disknod_auto('minor', index, disknod)
self._make_disknod_auto('major', index, disknod)
self._make_disknod_type(index, disknod)
disknod.mode = u'rwm'
disknod.permission = 'allow'
def _update_file(self, file_, index, container_path):
def _update_file(self, file_, index):
if not hasattr(file_, 'source'):
file_.source = basename(file_.name)
@ -362,7 +364,7 @@ class ContainerAnnotator:
# try to launch _update_xxxx() function
update_elt = '_update_' + elt_name
if hasattr(self, update_elt):
getattr(self, update_elt)(elt, index, path)
getattr(self, update_elt)(elt, index)
variables = []
subpath = '{}.{}{}'.format(path, name, index)
listname = '{}list'.format(name)
@ -385,7 +387,6 @@ class ContainerAnnotator:
{}).setdefault(
value,
[]).append(activate_path)
continue
default_type = 'string'
if key in self.objectspace.booleans_attributs:
default_type = 'boolean'
@ -484,20 +485,17 @@ class SpaceAnnotator(object):
self.filter_separators()
self.absolute_path_for_symlink_in_containers()
self.convert_helps()
#if hasattr(self.space, 'constraints'):
# print(vars(self.space.constraints))
def absolute_path_for_symlink_in_containers(self):
if not hasattr(self.space, 'containers'):
if not hasattr(self.space, 'containers') or not hasattr(self.space.containers, 'family'):
return
families = vars(self.space.containers).values()
families = self.space.containers.family.values()
for family in families:
if hasattr(family, 'family'):
for fam in family.family.values():
for fam1 in fam.family:
for variable in fam1.variable:
if variable.type == 'symlink' and '.' not in variable.name:
variable.opt = self.paths.get_variable_path(variable.opt, 'creole')
for fam in family.family:
for variable in fam.variable:
if variable.type == 'symlink' and '.' not in variable.name:
variable.opt = self.paths.get_variable_path(variable.opt, 'creole')
def convert_helps(self):
# FIXME l'aide doit etre dans la variable!
@ -554,9 +552,6 @@ class SpaceAnnotator(object):
leader_space = self.objectspace.Leadership()
leader_space.variable = []
leader_space.name = leader_name
leader_space.hidden = variable.hidden
variable.hidden = None
self.paths.append('family', leader_path + '.' + leader_name, namespace, creoleobj=leader_space)
# manage leader's variable
if variable.multi is not True:
raise CreoleDictConsistencyError(_('the variable {} in a group must be multi').format(variable.name))
@ -595,7 +590,6 @@ class SpaceAnnotator(object):
for variable in family.variable.values():
if isinstance(variable, self.objectspace.Leadership):
variable_mode = variable.variable[0].mode
variable.variable[0].mode = None
variable.mode = variable_mode
else:
variable_mode = variable.mode
@ -632,7 +626,7 @@ class SpaceAnnotator(object):
if variable.mode != None and variable.mode != modes_level[0] and modes[variable.mode] < modes[family_mode]:
variable.mode = family_mode
if variable.name == "available_probes":
variable.force_default_on_freeze = False
variable.force_default_on_freeze = False
def default_variable_options(self):
if hasattr(self.space, 'variables'):
@ -760,7 +754,7 @@ class SpaceAnnotator(object):
is_follower = True
else:
is_follower = False
path = '{}.{}.{}'.format(family.path, variable.name, follower.name)
path = '{}.{}.{}.{}'.format(variables.name, family.name, variable.name, follower.name)
self._annotate_variable(follower, family_mode, path, is_follower)
if HIGH_COMPATIBILITY:
# leader's variable are right
@ -783,7 +777,7 @@ class SpaceAnnotator(object):
# auto_freeze's variable is set in 'basic' mode if its mode is 'normal'
if variable.auto_freeze is True and variable.mode != modes_level[-1]:
variable.mode = modes_level[0]
path = '{}.{}'.format(family.path, variable.name)
path = '{}.{}.{}'.format(variables.name, family.name, variable.name)
self._annotate_variable(variable, family_mode, path)
def get_variable(self, name): # pylint: disable=C0111
@ -856,12 +850,7 @@ class SpaceAnnotator(object):
if variable.auto_save:
raise CreoleDictConsistencyError(_('variable with auto value '
'cannot be auto_save').format(auto.target))
leader = self.paths.get_leader(auto.target)
if leader is None or variable.name != leader:
variable.hidden = True
else:
leadership = self.paths.get_family_obj(self.paths.get_variable_family_path(auto.target))
leadership.hidden = True
variable.hidden = True
variable.frozen = True
variable.force_default_on_freeze = True
if 'fill' not in vars(space.constraints):
@ -886,8 +875,8 @@ class SpaceAnnotator(object):
names.append(separator.name)
def load_params_in_validenum(self, param):
if param.type in ['string', 'python', 'number']:
def load_params_in_validenum(self, param, probe):
if not probe and param.type in ['string', 'python', 'number']:
if not hasattr(param, 'text') and (param.type == 'python' or param.type == 'number'):
raise CreoleDictConsistencyError(_("All '{}' variables shall be set in order to calculate {}").format(param.type, 'valid_enum'))
if param.type in ['string', 'number']:
@ -895,7 +884,7 @@ class SpaceAnnotator(object):
values = literal_eval(param.text)
except ValueError:
raise CreoleDictConsistencyError(_('Cannot load {}').format(param.text))
elif param.type == 'python':
elif param.type == 'python':
try:
values = eval(param.text, {'eosfunc': self.eosfunc, '__builtins__': {'range': range, 'str': str}})
#FIXME : eval('[str(i) for i in range(3, 13)]', {'eosfunc': eosfunc, '__builtins__': {'range': range, 'str': str}})
@ -905,6 +894,8 @@ class SpaceAnnotator(object):
raise CreoleDictConsistencyError(_('Function {} shall return a list').format(param.text))
new_values = []
for val in values:
if sys.version_info[0] < 3 and isinstance(val, str):
val = val.decode('utf-8')
new_values.append(val)
values = new_values
else:
@ -1002,7 +993,7 @@ class SpaceAnnotator(object):
if proposed_value_type:
if param.type != 'eole':
try:
values = self.load_params_in_validenum(param)
values = self.load_params_in_validenum(param, check.probe)
except NameError as err:
raise CreoleDictConsistencyError(_('cannot load value for variable {}: {}').format(check.target, err))
add_value = True
@ -1014,7 +1005,7 @@ class SpaceAnnotator(object):
if check.target in self.valid_enums:
raise CreoleDictConsistencyError(_('valid_enum already set for {}'
'').format(check.target))
values = self.load_params_in_validenum(param)
values = self.load_params_in_validenum(param, check.probe)
self.valid_enums[check.target] = {'type': param.type,
'values': values}
remove_indexes.append(idx)
@ -1105,46 +1096,38 @@ class SpaceAnnotator(object):
del_idx.sort(reverse=True)
for idx in del_idx:
space.constraints.fill.pop(idx)
for fill in space.constraints.fill:
variable = self.paths.get_variable_obj(fill.target)
value = self.objectspace.value()
value.type = 'calculation'
value.name = fill.name
if hasattr(fill, 'param'):
value.param = fill.param
if not hasattr(variable, 'value'):
variable.value = []
variable.value.append(value)
self.force_not_mandatory.append(fill.target)
del space.constraints.fill
def filter_targets(self): # pylint: disable=C0111
for condition_idx, condition in enumerate(self.space.constraints.condition):
namespace = condition.namespace
del_idx = []
for idx, target in enumerate(condition.target):
if target.type == 'variable':
if (hasattr(target, 'optional') and target.optional is True and
not self.paths.path_is_defined(target.name)):
del_idx.append(idx)
continue
if condition.source == target.name:
raise CreoleDictConsistencyError(_('target name and source name must be different: {}').format(condition.source))
target.name = self.paths.get_variable_path(target.name, namespace)
elif target.type == 'family':
try:
target.name = self.paths.get_family_path(target.name, namespace)
except KeyError:
raise CreoleDictConsistencyError(_('cannot found family {}').format(target.name))
del_idx = list(set(del_idx))
del_idx.sort(reverse=True)
for idx in del_idx:
condition.target.pop(idx)
def filter_target(self, space, namespace): # pylint: disable=C0111
del_idx = []
for idx, target in enumerate(space.target):
if target.type == 'variable':
if (hasattr(target, 'optional') and target.optional is True and
not self.paths.path_is_defined(target.name)):
del_idx.append(idx)
continue
if space.source == target.name:
raise CreoleDictConsistencyError(_('target name and source name must be different: {}').format(space.source))
target.name = self.paths.get_variable_path(target.name, namespace)
elif target.type == 'family':
try:
target.name = self.paths.get_family_path(target.name, namespace)
except KeyError:
raise CreoleDictConsistencyError(_('cannot found family {}').format(target.name))
del_idx = list(set(del_idx))
del_idx.sort(reverse=True)
for idx in del_idx:
space.target.pop(idx)
def filter_condition_servicelist(self):
def filter_condition(self): # pylint: disable=C0111
if not hasattr(self.space, 'constraints') or not hasattr(self.space.constraints, 'condition'):
return
space = self.space.constraints.condition
remove_conditions = []
fallback_variables = []
fallback_lists = []
# automatic generation of the service_access lists
# and the service_restriction lists from the servicelist
for condition in self.space.constraints.condition:
for condition in space:
if hasattr(condition, 'target'):
new_targets = []
for target in condition.target:
@ -1160,15 +1143,20 @@ class SpaceAnnotator(object):
new_targets.append(new_target)
condition.target.extend(new_targets)
def check_condition_without_target(self):
for condition in self.space.constraints.condition:
if not hasattr(condition, 'target'):
raise CreoleDictConsistencyError(_('target is mandatory in condition'))
# remove condition with target
if HIGH_COMPATIBILITY:
for idx, condition in enumerate(space):
if not hasattr(condition, 'target'):
remove_conditions.append(idx)
def check_condition_fallback_not_exists(self, fallback_variables, fallback_lists):
# a condition with a fallback **and** the source variable doesn't exist
remove_conditions = []
for idx, condition in enumerate(self.space.constraints.condition):
for idx, condition in enumerate(space):
if idx in remove_conditions:
continue
if condition.name == 'hidden_if_in':
condition.name = 'disabled_if_in'
elif condition.name == 'hidden_if_not_in':
condition.name = 'disabled_if_not_in'
# a conditon with a fallback **and** the source variable doesn't exist
if (hasattr(condition, 'fallback') and condition.fallback is True and
not self.paths.path_is_defined(condition.source)):
for target in condition.target:
@ -1208,201 +1196,116 @@ class SpaceAnnotator(object):
variable.hidden = False
fallback_lists.append(listvar)
remove_conditions.append(idx)
remove_conditions = list(set(remove_conditions))
remove_conditions.sort(reverse=True)
for idx in remove_conditions:
self.space.constraints.condition.pop(idx)
def convert_xxxlist_to_variable(self, fallback_lists): # pylint: disable=C0111
for condition_idx, condition in enumerate(space):
if condition_idx in remove_conditions:
continue
namespace = condition.namespace
self.filter_target(condition, namespace)
# transform *list to variable or family
for condition_idx, condition in enumerate(self.space.constraints.condition):
new_targets = []
remove_targets = []
for target_idx, target in enumerate(condition.target):
if target.type not in ['variable', 'family']:
listname = target.type
if not listname.endswith('list'):
raise Exception('not yet implemented')
listvars = self.objectspace.list_conditions.get(listname,
{}).get(target.name)
if listvars:
for listvar in listvars:
if listvar in fallback_lists:
continue
try:
variable = self.get_variable(listvar)
type_ = 'variable'
except CreoleDictConsistencyError:
variable = self.paths.get_family_obj(listvar)
type_ = 'family'
new_target = self.objectspace.target()
new_target.type = type_
new_target.name = listvar
new_target.index = target.index
new_targets.append(new_target)
remove_targets.append(target_idx)
remove_targets = list(set(remove_targets))
remove_targets.sort(reverse=True)
for target_idx in remove_targets:
condition.target.pop(target_idx)
condition.target.extend(new_targets)
for condition_idx, condition in enumerate(space):
if condition.name in ['disabled_if_in', 'disabled_if_not_in', 'frozen_if_in', 'auto_frozen_if_in',
'frozen_if_not_in', 'mandatory_if_in', 'mandatory_if_not_in']:
new_targets = []
remove_targets = []
if not hasattr(condition, 'target'):
continue
for target_idx, target in enumerate(condition.target):
if target.type not in ['variable', 'family']:
listname = target.type
if not listname.endswith('list'):
raise Exception('not yet implemented')
listvars = self.objectspace.list_conditions.get(listname,
{}).get(target.name)
if listvars:
for listvar in listvars:
if listvar in fallback_lists:
continue
try:
variable = self.get_variable(listvar)
type_ = 'variable'
except CreoleDictConsistencyError:
variable = self.paths.get_family_obj(listvar)
type_ = 'family'
new_target = self.objectspace.target()
new_target.type = type_
new_target.name = listvar
new_target.index = target.index
new_targets.append(new_target)
remove_targets.append(target_idx)
remove_targets = list(set(remove_targets))
remove_targets.sort(reverse=True)
for target_idx in remove_targets:
condition.target.pop(target_idx)
condition.target.extend(new_targets)
def check_condition(self):
# if condition.name == 'hidden_if_in':
# condition.name = 'disabled_if_in'
# elif condition.name == 'hidden_if_not_in':
# condition.name = 'disabled_if_not_in'
for condition in self.space.constraints.condition:
if condition.name not in ['disabled_if_in', 'disabled_if_not_in', 'frozen_if_in', 'auto_frozen_if_in',
'frozen_if_not_in', 'mandatory_if_in', 'mandatory_if_not_in']:
raise CreoleDictConsistencyError(_('unknown condition {}').format(condition.name))
def check_params(self):
for condition in self.space.constraints.condition:
force_remove_targets = {}
for condition_idx, condition in enumerate(space):
if condition_idx in remove_conditions:
continue
namespace = condition.namespace
src_variable = self.paths.get_variable_obj(condition.source)
condition.source = self.paths.get_variable_path(condition.source, namespace, allow_source=True)
for param in condition.param:
if param.type not in TYPE_PARAM_CONDITION:
raise CreoleDictConsistencyError(_('cannot use {} type as a param '
'in a condition').format(param.type))
def check_choice_option_condition(self, force_remove_targets):
# remove condition for ChoiceOption that don't have param
remove_conditions = []
for condition_idx, condition in enumerate(self.space.constraints.condition):
namespace = condition.namespace
src_variable = self.paths.get_variable_obj(condition.source)
condition.source = self.paths.get_variable_path(condition.source, namespace, allow_source=True)
valid_enum = None
if condition.source in self.valid_enums and \
self.valid_enums[condition.source]['type'] == 'string':
valid_enum = self.valid_enums[condition.source]['values']
if src_variable.type in FORCE_CHOICE:
valid_enum = FORCE_CHOICE[src_variable.type]
if valid_enum is not None:
remove_param = []
for param_idx, param in enumerate(condition.param):
if param.text not in valid_enum:
remove_param.append(param_idx)
remove_param.sort(reverse=True)
for idx in remove_param:
del condition.param[idx]
if condition.param == []:
for target in condition.target:
if target.name.startswith('creole.'):
name = target.name.split('.')[-1]
else:
name = target.name
if target.type == 'variable':
variable = self.get_variable(name)
else:
variable = self.paths.get_family_obj(name)
if condition.name == 'disabled_if_not_in':
variable.disabled = True
force_remove_targets.setdefault(condition.name,
[]).append(target.name)
elif condition.name == 'frozen_if_not_in':
variable.hidden = True
force_remove_targets.setdefault(condition.name,
[]).append(target.name)
elif condition.name == 'mandatory_if_not_in':
variable.mandatory = True
force_remove_targets.setdefault(condition.name,
[]).append(target.name)
elif HIGH_COMPATIBILITY and condition.name == 'disabled_if_in':
variable.hidden = False
remove_conditions.append(condition_idx)
if condition.name in ['disabled_if_in', 'disabled_if_not_in', 'frozen_if_in', 'auto_frozen_if_in',
'frozen_if_not_in', 'mandatory_if_in', 'mandatory_if_not_in']:
valid_enum = None
# remove condition for ChoiceOption that don't have param
if condition.source in self.valid_enums and \
self.valid_enums[condition.source]['type'] == 'string':
valid_enum = self.valid_enums[condition.source]['values']
if src_variable.type in FORCE_CHOICE:
valid_enum = FORCE_CHOICE[src_variable.type]
if valid_enum is not None:
remove_param = []
for param_idx, param in enumerate(condition.param):
if param.text not in valid_enum:
remove_param.append(param_idx)
remove_param.sort(reverse=True)
for idx in remove_param:
del condition.param[idx]
if condition.param == []:
for target in condition.target:
if target.name.startswith('creole.'):
name = target.name.split('.')[-1]
else:
name = target.name
if target.type == 'variable':
variable = self.get_variable(name)
else:
variable = self.paths.get_family_obj(name)
if condition.name == 'disabled_if_not_in':
variable.disabled = True
force_remove_targets.setdefault(condition.name,
[]).append(target.name)
elif condition.name == 'frozen_if_not_in':
variable.hidden = True
force_remove_targets.setdefault(condition.name,
[]).append(target.name)
elif condition.name == 'mandatory_if_not_in':
variable.mandatory = True
force_remove_targets.setdefault(condition.name,
[]).append(target.name)
elif HIGH_COMPATIBILITY and condition.name == 'disabled_if_in':
variable.hidden = False
remove_conditions.append(condition_idx)
remove_conditions = list(set(remove_conditions))
remove_conditions.sort(reverse=True)
for idx in remove_conditions:
self.space.constraints.condition.pop(idx)
space.pop(idx)
def manage_variable_property(self, force_remove_targets, fallback_variables):
for condition in self.space.constraints.condition:
remove_targets = []
#parse each variable and family
for target_idx, target in enumerate(condition.target):
if target.name in force_remove_targets.get(condition.name, []):
remove_targets.append(target_idx)
if target.name.startswith('creole.'):
name = target.name.split('.')[-1]
else:
name = target.name
if target.type == 'variable':
variable = self.get_variable(name)
else:
variable = self.paths.get_family_obj(name)
if name in fallback_variables:
remove_targets.append(target_idx)
continue
if condition.name in ['disabled_if_in', 'disabled_if_not_in',
'frozen_if_in', 'frozen_if_not_in']:
variable.hidden = False
if condition.name in ['mandatory_if_in', 'mandatory_if_not_in']:
variable.mandatory = False
if HIGH_COMPATIBILITY and condition.name in ['frozen_if_in',
'frozen_if_not_in']:
self.has_frozen_if_in_condition.append(name)
if condition.name in ['mandatory_if_in', 'mandatory_if_not_in']:
self.force_not_mandatory.append(target.name)
for condition_idx, condition in enumerate(space):
if condition.name in ['disabled_if_in', 'disabled_if_not_in', 'frozen_if_in', 'auto_frozen_if_in',
'frozen_if_not_in', 'mandatory_if_in', 'mandatory_if_not_in']:
remove_targets = list(set(remove_targets))
remove_targets.sort(reverse=True)
for target_idx in remove_targets:
condition.target.pop(target_idx)
def remove_condition_with_empty_target(self):
remove_conditions = []
for condition_idx, condition in enumerate(self.space.constraints.condition):
if not condition.target:
remove_conditions.append(condition_idx)
remove_conditions = list(set(remove_conditions))
remove_conditions.sort(reverse=True)
for idx in remove_conditions:
self.space.constraints.condition.pop(idx)
def filter_condition(self): # pylint: disable=C0111
if not hasattr(self.space, 'constraints') or not hasattr(self.space.constraints, 'condition'):
return
fallback_variables = []
fallback_lists = []
force_remove_targets = {}
self.check_condition()
self.check_params()
self.check_condition_without_target()
self.filter_condition_servicelist()
self.check_condition_fallback_not_exists(fallback_variables, fallback_lists)
self.filter_targets()
self.convert_xxxlist_to_variable(fallback_lists)
self.check_choice_option_condition(force_remove_targets)
self.manage_variable_property(force_remove_targets, fallback_variables)
self.remove_condition_with_empty_target()
for condition in self.space.constraints.condition:
if condition.name == 'disabled_if_in':
actions = ['disabled']
inverse = False
elif condition.name == 'disabled_if_not_in':
actions = ['disabled']
inverse = True
elif condition.name == 'frozen_if_in':
actions = ['frozen', 'hidden', 'force_default_on_freeze']
inverse = False
elif condition.name == 'frozen_if_not_in':
actions = ['frozen', 'hidden', 'force_default_on_freeze']
inverse = True
elif condition.name == 'mandatory_if_in':
actions = ['mandatory']
inverse = False
elif condition.name == 'mandatory_if_not_in':
actions = ['mandatory']
inverse = True
elif condition.name == 'auto_frozen_if_in':
actions = ['auto_frozen']
inverse = True
for param in condition.param:
if hasattr(param, 'text'):
param = param.text
else:
param = None
for target in condition.target:
remove_targets = []
#parse each variable and family
for target_idx, target in enumerate(condition.target):
if target.name in force_remove_targets.get(condition.name, []):
remove_targets.append(target_idx)
if target.name.startswith('creole.'):
name = target.name.split('.')[-1]
else:
@ -1411,14 +1314,21 @@ class SpaceAnnotator(object):
variable = self.get_variable(name)
else:
variable = self.paths.get_family_obj(name)
if not hasattr(variable, 'property'):
variable.property = []
for action in actions:
prop = self.objectspace.property_()
prop.type = 'calculation'
prop.inverse = inverse
prop.source = condition.source
prop.expected = param
prop.name = action
variable.property.append(prop)
del self.space.constraints.condition
if name in fallback_variables:
remove_targets.append(target_idx)
continue
if condition.name in ['disabled_if_in', 'disabled_if_not_in',
'frozen_if_in', 'frozen_if_not_in']:
variable.hidden = False
if condition.name in ['mandatory_if_in', 'mandatory_if_not_in']:
variable.mandatory = False
if HIGH_COMPATIBILITY and condition.name in ['frozen_if_in',
'frozen_if_not_in']:
self.has_frozen_if_in_condition.append(name)
if condition.name in ['mandatory_if_in', 'mandatory_if_not_in']:
self.force_not_mandatory.append(target.name)
remove_targets = list(set(remove_targets))
remove_targets.sort(reverse=True)
for target_idx in remove_targets:
condition.target.pop(target_idx)

View File

@ -3,23 +3,79 @@
fichier de configuration pour créole
"""
from os.path import join, isfile
from os.path import join, isfile, isdir
eoledir = '/usr/share/eole'
LOCALKERNEL_FILE = join(eoledir, 'noyau/local')
REBOOT_FILE = '/var/run/reboot-required'
charset = 'UTF8'
# chemin par defaut des templates, fichier config.eol, etc
configeoldir = '/etc/eole/'
eoleroot = join(eoledir, 'creole')
vareole = '/var/lib/eole'
bareos_restore_root = join(eoledir, 'bareos')
bareos_restore = join(bareos_restore_root, 'restore')
configeol = join(configeoldir, 'config.eol')
# certificats
cert_file = '/etc/ssl/certs/eole.crt'
key_file = '/etc/ssl/certs/eole.key'
# port du serveur creole_serv
port_rpc = 4333
# chemin du répertoire source des fichiers templates
templatedir = '/var/lib/creole'
dicos_dir = join(eoleroot, 'dicos')
modif_dir = join(eoleroot, 'modif')
distrib_dir = join(eoleroot, 'distrib')
patch_dir = join(eoleroot, 'patch')
# chemin pour les fichiers de données
datadir = '/usr/share/creole'
# chemin pour les modules de fonctions supplémentaires
func_dir = join(datadir,'funcs')
# repertoire du ou des dictionnaires xml creole
eoledirs = [dicos_dir, join(dicos_dir, 'variante'), join(dicos_dir, 'local')]
# extra
eoleextradico = join(eoledir, 'creole/extra')
eoleextraconfig = join(configeoldir, 'extra')
forbiddenextra = ['containers', 'creole']
# repertoire de la dtd
dtddir = '/usr/share/creole'
dtddir = datadir
if isfile('data/creole.dtd'):
dtdfilename = 'data/creole.dtd'
elif isfile('../creole/data/creole.dtd'):
dtdfilename = '../creole/data/creole.dtd'
else:
dtdfilename = join(dtddir, 'creole.dtd')
# repertoire avec le fichier lock
LOCK_PATH = '/var/lock/eole'
LOCK_SYSTEM_PATH = join(LOCK_PATH, 'eole-system')
# Nom du serveur maitre
VIRTMASTER = 'root'
VIRTROOT = '/var/lib/lxc'
VIRTBASE = 'rootfs'
container_instance_lockfile = '/etc/eole/.container_instance.lock'
containers_default_network = '192.0.2'
gen_conteneurs_needed = '/etc/eole/.gen_conteneurs'
VIRTENABLED_LOCKFILE = '/etc/eole/.VirtEnabled.lock'
VIRTDISABLED_LOCKFILE = '/etc/eole/.VirtDisabled.lock'
INSTANCE_LOCKFILE = '/etc/eole/.instance'
UPGRADE_LOCKFILE = '/etc/eole/.upgrade-auto'
SSL_LAST_FILE = '/etc/eole/ssl/lastfile.txt'
FLATTENED_CREOLE_DIR = join(vareole, 'config')
if not isdir(FLATTENED_CREOLE_DIR):
FLATTENED_CREOLE_DIR = join('/tmp')

View File

@ -3,10 +3,33 @@
Erreurs Creole
"""
class VirtError(Exception):
"""incohérence concernant les conteneurs"""
pass
#class ValueEoleError(Exception):
# """Cette valeur n'existe pas"""
# pass
#
class NoneError(Exception):
"""Valeur vide"""
pass
class OutOfRange(Exception):
pass
class TypeEoleError(Exception):
"""Erreur de type"""
pass
class ConfigError(Exception):
pass
class NetworkConfigError(Exception):
""" Network configuration error
"""
pass
class FileNotFound(ConfigError):
pass
@ -18,6 +41,37 @@ class TemplateDisabled(TemplateError):
"""
pass
class DependencyError(ConfigError):
pass
#class ConstraintError(ConfigError):
# pass
#
class LockError(Exception):
""" Add lock error
"""
pass
class UnlockError(Exception):
""" Remove lock error
"""
pass
class UserExit(Exception):
""" User exit(0) signal
"""
pass
class UserExitError(Exception):
""" User exit(1) signal
"""
pass
class CreoleOperationError(Exception):
"""Type error or value Error for Creole variable's type or values

View File

@ -15,7 +15,7 @@ from tiramisu import Config, MetaConfig, MixConfig
from tiramisu.setting import groups
from tiramisu.error import ConfigError
from tiramisu.setting import owners
from tiramisu import Params, ParamOption, ParamValue, ParamContext, Calculation, calc_value
from tiramisu import Params, ParamOption, ParamValue, ParamContext
from .config import dtdfilename
from .i18n import _
@ -49,10 +49,8 @@ def convert_tiramisu_value(value, obj):
func = {IntOption: int, UnicodeOption: str, PortOption: str,
DomainnameOption: str, EmailOption: str, URLOption: str,
IPOption: str, NetmaskOption: str, NetworkOption: str,
BroadcastOption: str, FilenameOption: str,
BoolOption: _convert_boolean}.get(obj, None)
if func is None:
return value
BroadcastOption: str, FilenameOption: str
BoolOption: _convert_boolean}.get(obj, return)
if isinstance(value, list):
return [func(val) for val in value]
else:
@ -74,18 +72,17 @@ CONVERT_OPTION = {'number': dict(opttype=IntOption),
'netmask': dict(opttype=NetmaskOption),
'network': dict(opttype=NetworkOption),
'broadcast': dict(opttype=BroadcastOption),
'netbios': dict(opttype=DomainnameOption, initkwargs={'type': 'netbios', 'warnings_only': True}),
'domain': dict(opttype=DomainnameOption, initkwargs={'type': 'domainname', 'allow_ip': True, 'allow_without_dot': True}),
'domain_strict': dict(opttype=DomainnameOption, initkwargs={'type': 'domainname', 'allow_ip': False}),
'hostname': dict(opttype=DomainnameOption, initkwargs={'type': 'hostname', 'allow_ip': True}),
'hostname_strict': dict(opttype=DomainnameOption, initkwargs={'type': 'hostname', 'allow_ip': False}),
'netbios': dict(opttype=DomainnameOption, initkwargs={'type_': 'netbios', 'warnings_only': True}),
'domain': dict(opttype=DomainnameOption, initkwargs={'type_': 'domainname', 'allow_ip': True, 'allow_without_dot': True}),
'domain_strict': dict(opttype=DomainnameOption, initkwargs={'type_': 'domainname', 'allow_ip': False}),
'hostname': dict(opttype=DomainnameOption, initkwargs={'type_': 'hostname', 'allow_ip': True}),
'hostname_strict': dict(opttype=DomainnameOption, initkwargs={'type_': 'hostname', 'allow_ip': False}),
'web_address': dict(opttype=URLOption, initkwargs={'allow_ip': True, 'allow_without_dot': True}),
'port': dict(opttype=PortOption, initkwargs={'allow_private': True}),
'mac': dict(opttype=MACOption) # FIXME YO
}
# FIXME help
REMOVED_ATTRIB = ['path', 'type']
@ -121,7 +118,7 @@ class PopulateTiramisuObjects(object):
def make_tiramisu_objects(self, xmlroot, creolefunc_file, load_extra=True):
elt = Elt({'name': 'baseoption'})
family = Family(elt, self.booleans, self.storage)
family = Family(elt, self.booleans)
self.storage.add('.', family)
self.eosfunc = imp.load_source('eosfunc', creolefunc_file)
@ -156,14 +153,16 @@ class PopulateTiramisuObjects(object):
xmlelts = xmlelts_
for xmlelt in xmlelts:
if xmlelt.tag == 'family':
self._iter_family(xmlelt, family)
self._iter_family(xmlelt, family=family)
elif xmlelt.tag == 'help':
self._iter_help(xmlelt)
elif xmlelt.tag == 'constraints':
self._iter_constraints(xmlelt, load_extra)
else:
raise CreoleLoaderError(_('unknown tag {}').format(xmlelt.tag))
def _populate_variable(self, elt, subpath, is_follower, is_leader):
variable = Variable(elt, self.booleans, self.storage, is_follower, is_leader, self.eosfunc)
def _populate_variable(self, elt, subpath, is_slave, is_master):
variable = Variable(elt, self.booleans, self.storage, is_slave, is_master, self.eosfunc)
path = self._build_path(subpath, elt)
properties = variable.attrib.get('properties', [])
if 'force_store_value' in properties or "auto_freeze" in properties:
@ -176,7 +175,7 @@ class PopulateTiramisuObjects(object):
force_icon = False
else:
force_icon = not subpath.startswith('containers') and not subpath.startswith('actions')
family = Family(elt, self.booleans, self.storage, force_icon)
family = Family(elt, self.booleans, force_icon)
path = self._build_path(subpath, elt)
self.storage.add(path, family)
return family
@ -192,6 +191,8 @@ class PopulateTiramisuObjects(object):
for elt in xmlelt:
if elt.tag == 'fill':
self._parse_fill(elt, load_extra)
elif elt.tag == 'condition':
self._parse_condition(elt, load_extra)
elif elt.tag == 'check':
self._parse_check(elt, load_extra)
else:
@ -246,7 +247,10 @@ class PopulateTiramisuObjects(object):
# only for valid_enum with checkval to True
if len(elt) != 1:
raise CreoleLoaderError(_('valid_enum cannot have more than one param for {}').format(elt.attrib['target']))
if elt[0].attrib['type'] == 'eole':
if elt.attrib['probe'] == 'True':
proposed = elt[0].text
type_ = 'string'
elif elt[0].attrib['type'] == 'eole':
proposed = elt[0].text
type_ = 'eole'
else:
@ -346,68 +350,105 @@ class PopulateTiramisuObjects(object):
validator_params.setdefault(param.attrib.get('name', ''), []).append(text)
self.storage.add_validator(elt.attrib['target'], validator, validator_params)
def _iter_leader(self, leader, subpath):
subpath = self._build_path(subpath, leader)
family = Family(leader, self.booleans, self.storage)
family.set_leader()
def _parse_condition(self, elt, load_extra):
if not self._check_extra(elt.attrib['source'], load_extra):
return
if elt.attrib['name'] == 'disabled_if_in':
actions = ['disabled']
inverse = False
elif elt.attrib['name'] == 'disabled_if_not_in':
actions = ['disabled']
inverse = True
elif elt.attrib['name'] == 'auto_frozen_if_in':
actions = ['frozen']
inverse = False
elif elt.attrib['name'] == 'frozen_if_in':
actions = ['frozen', 'hidden', 'force_default_on_freeze']
inverse = False
elif elt.attrib['name'] == 'frozen_if_not_in':
actions = ['frozen', 'hidden', 'force_default_on_freeze']
inverse = True
elif elt.attrib['name'] == 'mandatory_if_in':
actions = ['mandatory']
inverse = False
elif elt.attrib['name'] == 'mandatory_if_not_in':
actions = ['mandatory']
inverse = True
else:
raise CreoleLoaderError(_('unknown condition type {} for {}').format(elt.attrib['name'], elt.attrib['source']))
expected_values = []
options = []
for param in elt:
if param.tag == 'param':
expected_values.append(param.text)
elif param.tag == 'target':
if param.attrib['type'] in ['variable', 'family']:
if not self._check_extra(param.text, load_extra):
return
option = self.storage.get(param.text)
option_actions = actions
if 'force_store_value' in option.attrib.get('properties', []) and \
'force_default_on_freeze' in option_actions:
option_actions.remove('force_default_on_freeze')
options.append((param.text, option_actions))
source = self.storage.get(elt.attrib['source'])
for option, actions in options:
conditions = []
for action in actions:
for expected in expected_values:
conditions.append({'option': source, 'expected': expected,
'action': action, 'inverse': inverse})
self.storage.add_requires(option, conditions)
def _iter_help(self, xmlelt):
for elt in xmlelt:
self.storage.add_help(elt.attrib['name'], elt.text)
def _iter_master(self, master, subpath):
subpath = self._build_path(subpath, master)
family = Family(master, self.booleans)
family.set_master()
self.storage.add(subpath, family)
leader_name = None
for var in leader:
if var.tag == 'property':
self._parse_properties(family, var)
elif var.tag == 'variable':
if leader_name is None:
leader_name = var.attrib['name']
self.groups[leader_name] = []
else:
self.groups[leader_name].append(var.attrib['name'])
self._iter_family(var, family, subpath=subpath)
master_name = None
for var in master:
if master_name is None:
master_name = var.attrib['name']
self.groups[master_name] = []
else:
raise CreoleLoaderError(_('unknown tag {}').format(var.tag))
self.groups[master_name].append(var.attrib['name'])
self._iter_family(var, subpath=subpath, family=family)
return family
def _iter_family(self, child, family, subpath=None):
if child.tag not in ['family', 'variable', 'separators', 'leader', 'property']:
def _iter_family(self, child, subpath=None, family=None):
if child.tag not in ['family', 'variable', 'separators', 'master']:
raise CreoleLoaderError(_('unknown tag {}').format(child.tag))
if child.tag == 'family':
old_family = family
family = self._populate_family(child, subpath)
if old_family is not None:
old_family.add(family)
if len(child) != 0:
subpath = self._build_path(subpath, child)
for c in child:
self._iter_family(c, family, subpath=subpath)
if child.tag == 'leader':
leader = self._iter_leader(child, subpath)
family.add(leader)
if child.tag == 'master':
master = self._iter_master(child, subpath)
family.add(master)
elif child.tag == 'separators':
self._parse_separators(child)
elif child.tag == 'variable':
if family is None:
raise CreoleLoaderError(_('variable without family'))
is_follower = False
is_leader = False
if family.is_leader:
is_slave = False
is_master = False
if family.is_master:
if child.attrib['name'] != family.attrib['name']:
is_follower = True
is_slave = True
else:
is_leader = True
variable = self._populate_variable(child, subpath, is_follower, is_leader)
is_master = True
variable = self._populate_variable(child, subpath, is_slave, is_master)
family.add(variable)
elif child.tag == 'property':
self._parse_properties(family, child)
def _parse_properties(self, family, child):
if child.get('type') == 'calculation':
kwargs = {'condition': child.attrib['source'],
'expected': ParamValue(child.attrib.get('expected'))}
if child.attrib['inverse'] == 'True':
kwargs['reverse_condition'] = ParamValue(True)
family.attrib['properties'].append((ParamValue(child.text), kwargs))
else:
family.attrib['properties'].append(child.text)
elif len(child) != 0:
subpath = self._build_path(subpath, child)
for c in child:
self._iter_family(c, subpath, family)
def _parse_separators(self, separators):
for separator in separators:
@ -446,13 +487,11 @@ class PopulateTiramisuObjects(object):
config.property.setdefault(rw_append, 'read_write', 'append')
config.property.read_only()
config.permissive.add('basic')
config.permissive.add('normal')
config.permissive.add('expert')
config.permissive.set(frozenset('basic', 'normal', 'expert', 'hidden'))
return config
class ElementStorage:
class ElementStorage(object):
def __init__(self):
self.paths = {}
@ -461,6 +500,10 @@ class ElementStorage:
raise CreoleLoaderError(_('path already loaded {}').format(path))
self.paths[path] = elt
def add_help(self, path, text):
elt = self.get(path)
self.paths[path].add_information('help', text)
def add_callback(self, path, callback, callback_params):
elt = self.get(path)
elt.add_callback(callback, callback_params)
@ -487,24 +530,8 @@ class ElementStorage:
return self.paths[path]
class Common:
def build_properties(self):
for index, prop in enumerate(self.attrib['properties']):
if isinstance(prop, tuple):
action, kwargs = prop
kwargs['condition'] = ParamOption(self.storage.get(kwargs['condition']).get(), todict=True)
prop = Calculation(calc_value,
Params(action,
kwargs=kwargs))
self.attrib['properties'][index] = prop
if self.attrib['properties']:
self.attrib['properties'] = tuple(self.attrib['properties'])
else:
del self.attrib['properties']
class Variable(Common):
def __init__(self, elt, booleans, storage, is_follower, is_leader, eosfunc):
class Variable(object):
def __init__(self, elt, booleans, storage, is_slave, is_master, eosfunc):
self.option = None
self.informations = {}
self.attrib = {}
@ -514,7 +541,6 @@ class Variable(Common):
self.consistencies = []
self.attrib['properties'] = []
self.eosfunc = eosfunc
self.storage = storage
for key, value in elt.attrib.items():
if key in REMOVED_ATTRIB:
continue
@ -528,10 +554,7 @@ class Variable(Common):
value = False
else:
raise CreoleLoaderError(_('unknown value {} for {}').format(value, key))
if key == 'help':
self.add_information(key, value)
else:
self.attrib[key] = value
self.attrib[key] = value
convert_option = CONVERT_OPTION[elt.attrib['type']]
self.object_type = convert_option['opttype']
if elt.attrib['type'] == 'choice':
@ -549,26 +572,19 @@ class Variable(Common):
self.attrib['values'].append(value)
self.attrib['values'] = tuple(self.attrib['values'])
for child in elt:
if "type" in child.attrib:
type_ = CONVERT_OPTION[child.attrib['type']]['opttype']
else:
type_ = self.object_type
if child.tag == 'property':
if child.get('type') == 'calculation':
kwargs = {'condition': child.attrib['source'],
'expected': ParamValue(child.attrib.get('expected'))}
if child.attrib['inverse'] == 'True':
kwargs['reverse_condition'] = ParamValue(True)
self.attrib['properties'].append((ParamValue(child.text), kwargs))
else:
self.attrib['properties'].append(child.text)
self.attrib['properties'].append(child.text)
elif child.tag == 'value':
if "type" in child.attrib:
type_ = CONVERT_OPTION[child.attrib['type']]['opttype']
else:
type_ = self.object_type
if self.attrib['multi'] and not is_follower:
if self.attrib['multi'] and not is_slave:
if 'default' not in self.attrib:
self.attrib['default'] = []
value = convert_tiramisu_value(child.text, type_)
self.attrib['default'].append(value)
if 'default_multi' not in self.attrib and not is_leader:
if 'default_multi' not in self.attrib and not is_master:
self.attrib['default_multi'] = value
else:
if 'default' in self.attrib:
@ -577,12 +593,13 @@ class Variable(Common):
value = convert_tiramisu_value(child.text, type_)
if value is None: # and (elt.attrib['type'] != 'choice' or value not in self.attrib['values']):
value = u''
if is_follower:
if is_slave:
self.attrib['default_multi'] = value
else:
self.attrib['default'] = value
if 'initkwargs' in convert_option:
self.attrib.update(convert_option['initkwargs'])
self.attrib['properties'] = tuple(self.attrib['properties'])
if elt.attrib['type'] == 'symlink':
del self.attrib['properties']
del self.attrib['multi']
@ -631,19 +648,17 @@ class Variable(Common):
if self.option is None:
if self.object_type is SymLinkOption:
self.attrib['opt'] = self.attrib['opt'].get()
else:
self.build_properties()
#for callback, callback_params in self.callbacks:
# self.attrib['callback'] = callback
# self.attrib['callback_params'] = self.build_params(callback_params)
#for require in self.requires:
# if isinstance(require['option'], Variable):
# require['option'] = require['option'].get()
#if self.requires != []:
# self.attrib['requires'] = self.requires
#if self.validator:
# self.attrib['validator'] = self.validator[0]
# self.attrib['validator_params'] = self.build_params(self.validator[1])
for callback, callback_params in self.callbacks:
self.attrib['callback'] = callback
self.attrib['callback_params'] = self.build_params(callback_params)
for require in self.requires:
if isinstance(require['option'], Variable):
require['option'] = require['option'].get()
if self.requires != []:
self.attrib['requires'] = self.requires
if self.validator:
self.attrib['validator'] = self.validator[0]
self.attrib['validator_params'] = self.build_params(self.validator[1])
try:
option = self.object_type(**self.attrib)
except Exception as err:
@ -653,36 +668,35 @@ class Variable(Common):
raise CreoleLoaderError(_('cannot create option {}: {}').format(name, err))
for key, value in self.informations.items():
option.impl_set_information(key, value)
#for consistency in self.consistencies:
# options = []
# for variable in consistency[1]:
# options.append(variable.get())
# try:
# kwargs = {}
# if consistency[2] == 'True':
# kwargs['warnings_only'] = True
# if consistency[3] == 'False':
# kwargs['transitive'] = False
# option.impl_add_consistency(consistency[0], *options, **kwargs)
# except ConfigError as err:
# name = self.attrib['name']
# raise CreoleLoaderError(_('cannot load consistency for {}: {}').format(name, err))
for consistency in self.consistencies:
options = []
for variable in consistency[1]:
options.append(variable.get())
try:
kwargs = {}
if consistency[2] == 'True':
kwargs['warnings_only'] = True
if consistency[3] == 'False':
kwargs['transitive'] = False
option.impl_add_consistency(consistency[0], *options, **kwargs)
except ConfigError as err:
name = self.attrib['name']
raise CreoleLoaderError(_('cannot load consistency for {}: {}').format(name, err))
self.option = option
return self.option
class Family(Common):
def __init__(self, elt, booleans, storage, force_icon=False):
class Family(object):
def __init__(self, elt, booleans, force_icon=False):
self.requires = []
self.option = None
self.attrib = {}
self.is_leader = False
self.is_master = False
if force_icon:
self.informations = {'icon': None}
else:
self.informations = {}
self.children = []
self.storage = storage
self.attrib['properties'] = []
for key, value in elt.attrib.items():
if key in REMOVED_ATTRIB:
@ -702,12 +716,11 @@ class Family(Common):
self.attrib['properties'].append(key)
elif key == 'mode':
self.attrib['properties'].append(value)
elif key == 'help':
self.add_information(key, value)
else:
self.attrib[key] = value
if 'doc' not in self.attrib:
self.attrib['doc'] = u''
self.attrib['properties'] = tuple(self.attrib['properties'])
def add(self, child):
self.children.append(child)
@ -717,8 +730,8 @@ class Family(Common):
raise CreoleLoaderError(_('key already exists in information {}').format(key))
self.informations[key] = value
def set_leader(self):
self.is_leader = True
def set_master(self):
self.is_master = True
def add_requires(self, requires):
self.requires.extend(requires)
@ -733,9 +746,8 @@ class Family(Common):
require['option'] = require['option'].get()
if self.requires != []:
self.attrib['requires'] = self.requires
self.build_properties()
try:
if not self.is_leader:
if not self.is_master:
option = OptionDescription(**self.attrib)
else:
option = Leadership(**self.attrib)
@ -745,7 +757,7 @@ class Family(Common):
for key, value in self.informations.items():
option.impl_set_information(key, value)
self.option = option
#if self.is_leader:
# self.option.impl_set_group_type(groups.leader)
#if self.is_master:
# self.option.impl_set_group_type(groups.master)
return self.option

View File

@ -25,6 +25,7 @@ has to be moved in family2. The visit procedure changes the varable1's object sp
"""
from collections import OrderedDict
from lxml.etree import Element, SubElement # pylint: disable=E0611
import sys
from json import dump
@ -59,7 +60,6 @@ class CreoleObjSpace(object):
"""DOM XML reflexion free internal representation of a Creole Dictionary
"""
choice = type('Choice', (RootCreoleObject,), OrderedDict())
property_ = type('Property', (RootCreoleObject,), OrderedDict())
# Creole ObjectSpace's Leadership variable class type
Leadership = type('Leadership', (RootCreoleObject,), OrderedDict())
"""
@ -92,7 +92,7 @@ class CreoleObjSpace(object):
self.forced_text_elts = set()
# ['disknod', 'follower', 'target', 'service', 'package', 'ip', 'value', 'tcpwrapper',
# 'interface', 'input', 'port']
self.forced_text_elts_as_name = set(['choice', 'property'])
self.forced_text_elts_as_name = set(['choice'])
self.forced_choice_option = {}
self.paths = Path()
self.list_conditions = {}
@ -506,7 +506,7 @@ class CreoleObjSpace(object):
if not attr.startswith('_'):
yield attr
def _sub_xml_export(self, name, node, node_name, space, current_space):
def _sub_xml_export(self, name, node, node_name, space):
if isinstance(space, dict):
space = list(space.values())
if isinstance(space, list):
@ -533,23 +533,27 @@ class CreoleObjSpace(object):
child_node = SubElement(node, name)
for subname in self._get_attributes(space):
subspace = getattr(space, subname)
self._sub_xml_export(subname, child_node, name, subspace, space)
self._sub_xml_export(subname, child_node, name, subspace)
elif isinstance(space, self.Redefinable):
child_node = SubElement(node, 'family')
child_node.attrib['name'] = name
for subname in self._get_attributes(space):
subspace = getattr(space, subname)
self._sub_xml_export(subname, child_node, name, subspace, space)
self._sub_xml_export(subname, child_node, name, subspace)
else:
# FIXME plutot dans annotator ...
if name in PROPERTIES and node.tag in ['variable', 'family', 'leader']:
if name in PROPERTIES and node.tag == 'variable':
if space is True:
for prop in CONVERT_PROPERTIES.get(name, [name]):
SubElement(node, 'property').text = prop
if sys.version_info[0] < 3:
SubElement(node, 'property').text = unicode(prop)
else:
SubElement(node, 'property').text = prop
elif name not in ERASED_ATTRIBUTES:
if name == 'name' and node_name in self.forced_text_elts_as_name and not hasattr(current_space, 'param'):
if isinstance(space, str):
if name == 'name' and node_name in self.forced_text_elts_as_name:
if sys.version_info[0] < 3 and isinstance(space, unicode):
node.text = space
elif isinstance(space, str):
node.text = space
else:
node.text = str(space)
@ -559,19 +563,22 @@ class CreoleObjSpace(object):
if 'doc' not in node.attrib.keys():
node.attrib['doc'] = space
node.attrib['name'] = normalize_family(space, check_name=False)
elif node.tag in ['variable', 'family', 'leader'] and name == 'mode':
elif node.tag == 'variable' and name == 'mode':
if space is not None:
SubElement(node, 'property').text = space
else:
if name in RENAME_ATTIBUTES:
name = RENAME_ATTIBUTES[name]
if space is not None:
node.attrib[name] = str(space)
if sys.version_info[0] < 3:
node.attrib[name] = unicode(space)
else:
node.attrib[name] = str(space)
def _xml_export(self, node, space, node_name='creole'):
for name in self._get_attributes(space):
subspace = getattr(space, name)
self._sub_xml_export(name, node, node_name, subspace, space)
self._sub_xml_export(name, node, node_name, subspace)
class Path(object):
@ -683,9 +690,10 @@ class Path(object):
def _get_variable(self, name):
if name not in self.variables:
if name.startswith('creole.'):
name = name.split('.')[-1]
if name not in self.variables:
raise CreoleDictConsistencyError(_('unknown option {}').format(name))
raise CreoleDictConsistencyError(
_("don't set full path variable in creole's namespace "
"(set '{}' not '{}')").format(name.split('.')[-1], name))
raise CreoleDictConsistencyError(_('unknown option {}').format(name))
return self.variables[name]
def get_leader(self, name): # pylint: disable=C0111

View File

@ -31,7 +31,7 @@ Parser.encodingDirectiveRE = FakeEncoding()
from Cheetah.Template import Template as ChtTemplate
from Cheetah.NameMapper import NotFound as CheetahNotFound
from config import patch_dir, templatedir, distrib_dir
import config as cfg
from .client import CreoleClient, CreoleClientError
from .error import FileNotFound, TemplateError, TemplateDisabled
@ -290,13 +290,13 @@ class CreoleTemplateEngine(object):
def patch_template(self, filevar, force_no_active=False):
"""Apply patch to a template
"""
var_dir = os.path.join(patch_dir,'variante')
patch_cmd = ['patch', '-d', templatedir, '-N', '-p1']
var_dir = os.path.join(cfg.patch_dir,'variante')
patch_cmd = ['patch', '-d', cfg.templatedir, '-N', '-p1']
patch_no_debug = ['-s', '-r', '-', '--backup-if-mismatch']
tmpl_filename = os.path.split(filevar[u'source'])[1]
# patches variante + locaux
for directory in [var_dir, patch_dir]:
for directory in [var_dir, cfg.patch_dir]:
patch_file = os.path.join(directory, '{0}.patch'.format(tmpl_filename))
if os.access(patch_file, os.F_OK):
msg = _(u"Patching template '{0}' with '{1}'")
@ -359,13 +359,13 @@ class CreoleTemplateEngine(object):
"""
self._check_filevar(filevar, force_no_active)
tmpl_source_name = os.path.split(filevar[u'source'])[1]
tmpl_source_file = os.path.join(distrib_dir, tmpl_source_name)
tmpl_source_file = os.path.join(cfg.distrib_dir, tmpl_source_name)
if not os.path.isfile(tmpl_source_file):
msg = _(u"Template {0} unexistent").format(tmpl_source_file)
raise FileNotFound(msg)
else:
log.info(_(u"Copy template: '{0}' -> '{1}'").format(tmpl_source_file, templatedir))
shutil.copy(tmpl_source_file, templatedir)
log.info(_(u"Copy template: '{0}' -> '{1}'").format(tmpl_source_file, cfg.templatedir))
shutil.copy(tmpl_source_file, cfg.templatedir)
def prepare_template(self, filevar, force_no_active=False):
"""Prepare template source file
@ -578,8 +578,8 @@ class CreoleTemplateEngine(object):
for group_name in self.client.get_groups():
containers_ctx.append(self.client.get_group_infos(group_name))
if filenames is None:
all_files = set(listdir(distrib_dir))
prev_files = set(listdir(templatedir))
all_files = set(listdir(cfg.distrib_dir))
prev_files = set(listdir(cfg.templatedir))
all_declared_files = set()
for ctx in containers_ctx:
for fdict in ctx[u'files']:
@ -588,12 +588,12 @@ class CreoleTemplateEngine(object):
toremove_files = prev_files - all_files
# delete old templates (#6600)
for fname in toremove_files:
rm_file = join(templatedir, fname)
rm_file = join(cfg.templatedir, fname)
log.debug(_(u"Removing file '{0}'").format(rm_file))
unlink(rm_file)
# copy template not referenced in a dictionary (#6303)
for fname in undeclared_files:
fobj = {'source': join(templatedir, fname), 'name': ''}
fobj = {'source': join(cfg.templatedir, fname), 'name': ''}
self.prepare_template(fobj, True)
for ctx in containers_ctx:

View File

@ -1,16 +1,183 @@
# -*- coding: UTF-8 -*-
"""
utilitaires créole
"""
import unicodedata
import sys
from .error import NoneError, OutOfRange
from .config import charset
try:
from pyeole.ansiprint import *
except:
pass
import time, hashlib, random, unicodedata
# définition des classes d'adresse IP existantes
classes = {
u'128.0.0.0' : u'1'
, u'192.0.0.0' : u'2'
, u'224.0.0.0' : u'3'
, u'240.0.0.0' : u'4'
, u'248.0.0.0' : u'5'
, u'252.0.0.0' : u'6'
, u'254.0.0.0' : u'7'
, u'255.0.0.0' : u'8'
, u'255.128.0.0' : u'9'
, u'255.192.0.0' : u'10'
, u'255.224.0.0' : u'11'
, u'255.240.0.0' : u'12'
, u'255.248.0.0' : u'13'
, u'255.252.0.0' : u'14'
, u'255.254.0.0' : u'15'
, u'255.255.0.0' : u'16'
, u'255.255.128.0' : u'17'
, u'255.255.192.0' : u'18'
, u'255.255.224.0' : u'19'
, u'255.255.240.0' : u'20'
, u'255.255.248.0' : u'21'
, u'255.255.252.0' : u'22'
, u'255.255.254.0' : u'23'
, u'255.255.255.0' : u'24'
, u'255.255.255.128' : u'25'
, u'255.255.255.192' : u'26'
, u'255.255.255.224' : u'27'
, u'255.255.255.240' : u'28'
, u'255.255.255.248' : u'29'
, u'255.255.255.252' : u'30'
, u'255.255.255.254' : u'31'
, u'255.255.255.255' : u'32'
}
def string_to_bool(string):
"""
Transforme les chaines 'True' ou 'False' en valeurs booléennes
"""
if string == "":
raise ValueError('empty string')
result = eval(string)
if result not in [True, False]:
raise TypeError("string must be like 'True' or 'False'")
else: return result
def get_text_node(node):
"""
@param node: node minidom contenant du texte
Utilitaire minidom permettant de récupérer le texte d'un node texte
"""
texte = ""
nodelist = node.childNodes
for textnode in nodelist:
if textnode.nodeType == textnode.TEXT_NODE:
texte = texte + textnode.data
return texte
# utilitaires pour la
# ligne de commande
def raw(text):
"""
Question en ligne de commande : permet de repérer si l'utilisateur a renvoyé quelque chose
@param text: le libellé de message
@return: la variable demandée
"""
var = raw_input(text + " : ")
if var:
return var
else:
raise NoneError
def stringify(string):
"""
Encodage des chaînes avec le charset local
"""
try:
return string.encode(charset)
except:
return string
def encode_list(_list):
""" encode une liste en utf-8 si les éléments sont de type dico ou str ou liste, unicode"""
encoded_list = []
for element in _list:
if type(element) == str:
encoded_list.append(encode_str(element))
elif type(element) == dict:
encoded_list.append(encode_dico(element))
elif type(element) == list:
encoded_list.append(encode_list(element))
elif type(element) == unicode:
encoded_list.append(encode_str(element))
else:
encoded_list.append(element)
return encoded_list
def encode_str(string):
""" encode une string ou un unicode en utf8 """
try:
string = string.encode(charset)
except:
pass
return string
def encode_dico(dico):
""" encode un dico en utf8 dans le cas ou les valeurs soient de type dico, liste, str, unicode """
for key in dico.keys():
if type(dico[key]) == str:
dico[key] = encode_str(dico[key])
elif type(dico[key]) == unicode:
dico[key] = encode_str(dico[key])
elif type(dico[key]) == dict:
dico[key] = encode_dico(dico[key])
elif type(dico[key]) == list:
dico[key] = encode_list(dico[key])
return dico
def select_list(selection):
"""
Utilitaire de construction d'une sélection en ligne de commande
@param selection : liste
@return : l'identifiant sélectionné (entier)
"""
# affichage de la liste (ordonnée)
for i in selection:
print(selection.index(i) , ':', stringify(i))
# print selection.index(i) , ':', i[0]
# recuperation du numero
try:
number = int(raw(stringify(_("Choose a number in the list"))))
except:
raise OutOfRange
if number not in range(len(selection)):
raise OutOfRange
return number
def gen_random(length=None):
"""
length: longueur de la chaine aléatoire attendu
"""
try:
random_id = str(time.time()).split('.')[0]
random_str = hashlib.sha224('{}/{}'.format(random_id, str(random.randrange(2**100))).encode('utf-8')).hexdigest()
return random_str[:length]
except:
import traceback
traceback.print_exc()
def normalize_family(family_name, check_name=True):
"""
il ne faut pas d'espace, d'accent, de majuscule, de tiré, ...
dans le nom des familles
"""
f = family_name
if sys.version_info[0] < 3:
f = unicode(family_name)
else:
f = family_name
f = f.replace('-', '_')
#f = f.replace(u'é', 'e')
#f = f.replace(u'è', 'e')
@ -18,9 +185,13 @@ def normalize_family(family_name, check_name=True):
f = u"".join([c for c in nfkd_form if not unicodedata.combining(c)])
f = f.replace(' ', '_')
f = f.lower()
if f[0].isnumeric():
try:
int(f[0])
except ValueError:
pass
else:
raise ValueError(u'Le nom de la famille ne doit pas commencer par un chiffre : {0}'.format(f))
if check_name and f == 'containers':
if check_name and f.lower() in ['containers']:
raise ValueError(u'nom de la famille interdit {0}'.format(f))
return f

View File

@ -1,12 +1,17 @@
# coding: utf-8
from os.path import join, isfile, basename, isdir
from os import listdir
#from io import BytesIO
from base64 import decodestring
from io import BytesIO
from collections import OrderedDict
import sys
from lxml.etree import DTD, parse, tostring # , XMLParser
from lxml.etree import DTD, parse, tostring, XMLParser # pylint: disable=E0611
from .i18n import _
from .utils import normalize_family
from .error import CreoleDictConsistencyError
from .config import VIRTBASE, VIRTROOT, VIRTMASTER, templatedir
HIGH_COMPATIBILITY = True
@ -30,16 +35,19 @@ class XMLReflector(object):
with open(dtdfilename, 'r') as dtdfd:
self.dtd = DTD(dtdfd)
def parse_xmlfile(self, xmlfile):
def parse_xmlfile(self, xmlfile, from_zephir=None, zephir2=False):
"""Parses and validates some Creole XML against the Creole DTD
:returns: the root element tree object
"""
# FIXME zephir2
# document = parse(BytesIO(xmlfile), XMLParser(remove_blank_text=True))
document = parse(xmlfile)
if not self.dtd.validate(document):
raise CreoleDictConsistencyError(_("not a valid xml file: {}").format(xmlfile))
if from_zephir:
if zephir2:
document = parse(BytesIO(xmlfile), XMLParser(remove_blank_text=True))
else:
document = parse(BytesIO(decodestring(xmlfile)), XMLParser(remove_blank_text=True))
else:
document = parse(xmlfile)
assert self.dtd.validate(document), _("not a valid xml file: {}").format(xmlfile)
return document.getroot()
def load_xml_from_folders(self, xmlfolders, from_zephir):
@ -93,4 +101,7 @@ class XMLReflector(object):
"""Write a bunch of XML on the disk
"""
with open(xmlfilename, 'w') as xmlfh:
xmlfh.write(tostring(xml, pretty_print=True, encoding="UTF-8", xml_declaration=True).decode('utf8'))
if sys.version_info[0] < 3:
xmlfh.write(tostring(xml, pretty_print=True, encoding="UTF-8", xml_declaration=True))
else:
xmlfh.write(tostring(xml, pretty_print=True, encoding="UTF-8", xml_declaration=True).decode('utf8'))

View File

@ -200,6 +200,7 @@
<!ATTLIST check name CDATA #REQUIRED>
<!ATTLIST check target CDATA #REQUIRED>
<!ATTLIST check level (error|warning) "error">
<!ATTLIST check probe (True|False) "False">
<!ELEMENT auto ((param)*)>
<!ATTLIST auto name CDATA #REQUIRED>

View File

@ -1,8 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<family name="containers">
<family name="container0" doc="tata">
<property>basic</property>
</family>
<family name="container0" doc="tata" hidden="False" mode="basic"/>
</family>
</creole>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "non", "creole.general.module_instancie": "non"}

View File

@ -1,9 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="auto_frozen_if_in" source="creole.general.module_instancie">
<param hidden="True" type="string">oui</param>
<target type="variable">creole.general.mode_conteneur_actif</target>
</condition>
</constraints>
<family doc="" name="creole">
<family doc="général" name="general">
<property>basic</property>
<family hidden="False" mode="basic" doc="général" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<property>force_store_value</property>
<property>auto_freeze</property>
@ -11,7 +15,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>basic</property>
<property expected="oui" inverse="True" source="creole.general.module_instancie" type="calculation">auto_frozen</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="module_instancie" type="choice">

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "non", "creole.general.module_instancie": "non"}

View File

@ -1,9 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="auto_frozen_if_in" source="creole.general.module_instancie">
<param hidden="True" type="string">oui</param>
<target type="variable">creole.general.mode_conteneur_actif</target>
</condition>
</constraints>
<family doc="" name="creole">
<family doc="général" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="général" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<property>force_store_value</property>
<property>auto_freeze</property>
@ -11,7 +15,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>expert</property>
<property expected="oui" inverse="True" source="creole.general.module_instancie" type="calculation">auto_frozen</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="module_instancie" type="choice">

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "non"}

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="général" name="general">
<property>basic</property>
<family hidden="False" mode="basic" doc="général" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<property>force_store_value</property>
<choice type="string">oui</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "non"}

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="général" name="general">
<property>expert</property>
<family hidden="False" mode="expert" doc="général" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<property>force_store_value</property>
<choice type="string">oui</choice>

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="général" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="général" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -1 +0,0 @@
{"creole.general.without_type": "non"}

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="général" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="général" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="général" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="général" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="général" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="général" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif1": "non"}

View File

@ -1,9 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general.mode_conteneur_actif">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -12,9 +15,6 @@
<property>hidden</property>
<property>mandatory</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">
<choice type="string">oui</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif1": "non"}

View File

@ -1,9 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general.mode_conteneur_actif"/>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -12,7 +13,6 @@
<property>hidden</property>
<property>mandatory</property>
<property>normal</property>
<value type="calculation">calc_val</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">
<choice type="string">oui</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": null, "creole.general.mode_conteneur_actif1": "non", "creole.general.module_instancie": "non"}

View File

@ -1,9 +1,16 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="auto_frozen_if_in" source="creole.general.module_instancie">
<param hidden="True" type="string">oui</param>
<target type="variable">creole.general.mode_conteneur_actif</target>
</condition>
<fill name="calc_val" target="creole.general.mode_conteneur_actif">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>basic</property>
<family hidden="False" mode="basic" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<property>force_store_value</property>
<property>auto_freeze</property>
@ -11,10 +18,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>basic</property>
<property expected="oui" inverse="True" source="creole.general.module_instancie" type="calculation">auto_frozen</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">
<choice type="string">oui</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": null, "creole.general.mode_conteneur_actif1": "non"}

View File

@ -1,18 +1,18 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general.mode_conteneur_actif">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>basic</property>
<family hidden="False" mode="basic" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<property>force_store_value</property>
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>basic</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">
<choice type="string">oui</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif1": "non"}

View File

@ -1,9 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general.mode_conteneur_actif">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -12,9 +15,6 @@
<property>hidden</property>
<property>mandatory</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">
<choice type="string">oui</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif1": "non"}

View File

@ -1,9 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general.mode_conteneur_actif">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="Général" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="Général" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -12,9 +15,6 @@
<property>hidden</property>
<property>mandatory</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">
<choice type="string">oui</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif1": null}

View File

@ -1,9 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="get_zone_name_bridge" target="creole.general.mode_conteneur_actif1">
<param hidden="True" name="nom_carte" type="eole">creole.general.mode_conteneur_actif</param>
<param hidden="True" name="context" type="context"/>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -19,10 +23,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<value name="get_zone_name_bridge" type="calculation">
<param hidden="True" name="nom_carte" type="eole">creole.general.mode_conteneur_actif</param>
<param hidden="True" name="context" type="context"/>
</value>
</variable>
</family>
<separators/>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": null, "creole.general.mode_conteneur_actif1": "non"}

View File

@ -1,15 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general.mode_conteneur_actif">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="domain">
<property>mandatory</property>
<property>expert</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">
<choice type="string">oui</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif1": "non"}

View File

@ -1,17 +1,17 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general.mode_conteneur_actif">
<param hidden="True" type="number">3</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="number">
<property>force_default_on_freeze</property>
<property>frozen</property>
<property>hidden</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="number">3</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">
<choice type="string">oui</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif1": "non"}

View File

@ -1,9 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general.mode_conteneur_actif">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -12,9 +15,6 @@
<property>hidden</property>
<property>mandatory</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.mode_conteneur_actif1</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif1" type="choice">
<choice type="string">oui</choice>

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -1,9 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general.autosavevar">
<param hidden="True" type="string">oui</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="général" name="general">
<property>basic</property>
<family hidden="False" mode="basic" doc="général" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -19,9 +22,6 @@
<property>frozen</property>
<property>hidden</property>
<property>basic</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="string">oui</param>
</value>
</variable>
</family>
<separators/>

View File

@ -1 +0,0 @@
{"creole.general.autosavevar": null}

View File

@ -1,9 +1,16 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="frozen_if_in" source="creole.general.mode_conteneur_actif">
<param hidden="True" type="string">oui</param>
<target type="variable">creole.general.autosavevar</target>
</condition>
<fill name="calc_val" target="creole.general.autosavevar">
<param hidden="True" type="string">oui</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="général" name="general">
<property>basic</property>
<family hidden="False" mode="basic" doc="général" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -17,12 +24,6 @@
<variable doc="autosave variable" multi="False" name="autosavevar" type="string">
<property>force_store_value</property>
<property>basic</property>
<property expected="oui" inverse="False" source="creole.general.mode_conteneur_actif" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="creole.general.mode_conteneur_actif" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="creole.general.mode_conteneur_actif" type="calculation">force_default_on_freeze</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="string">oui</param>
</value>
</variable>
</family>
<separators/>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "b", "creole.general.int": null}

View File

@ -1,14 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints>
<check name="valid_entier" target="creole.general.int" transitive="True" warnings_only="False">
<check name="valid_entier" probe="False" target="creole.general.int" transitive="True" warnings_only="False">
<param name="mini" type="string">0</param>
<param name="maxi" type="string">100</param>
</check>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="string">
<property>mandatory</property>
<property>normal</property>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "b", "creole.general.int2": 100, "creole.general.int": null}

View File

@ -1,14 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints>
<check name="valid_entier" target="creole.general.int" transitive="True" warnings_only="False">
<check name="valid_entier" probe="False" target="creole.general.int" transitive="True" warnings_only="False">
<param name="mini" type="string">0</param>
<param name="maxi" type="eole">creole.general.int2</param>
</check>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="string">
<property>mandatory</property>
<property>normal</property>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "b", "creole.general.int": null, "creole.general.int2": null}

View File

@ -1,14 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints>
<check name="valid_differ" target="creole.general.int" transitive="True" warnings_only="False">
<check name="valid_differ" probe="False" target="creole.general.int" transitive="True" warnings_only="False">
<param type="eole">creole.general.int2</param>
</check>
<check name="valid_differ" target="creole.general.int" transitive="True" warnings_only="False"/>
<check name="valid_differ" probe="False" target="creole.general.int" transitive="True" warnings_only="False"/>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="string">
<property>mandatory</property>
<property>normal</property>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "oui", "creole.general.mode_conteneur_actif1": "non"}

View File

@ -1,13 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints>
<check name="valid_differ" target="creole.general.mode_conteneur_actif" transitive="True" warnings_only="False">
<check name="valid_differ" probe="False" target="creole.general.mode_conteneur_actif" transitive="True" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif1</param>
</check>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "oui", "creole.general.mode_conteneur_actif1": "non", "creole.general.mode_conteneur_actif2": "non", "creole.general.mode_conteneur_actif3": "oui"}

View File

@ -1,22 +1,21 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints>
<check name="valid_differ" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<check name="valid_differ" probe="False" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif1</param>
</check>
<check name="valid_differ" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<check name="valid_differ" probe="False" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif2</param>
</check>
<check name="valid_differ" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<check name="valid_differ" probe="False" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif1</param>
</check>
<check name="valid_differ" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<check name="valid_differ" probe="False" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif2</param>
</check>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "oui", "creole.general.mode_conteneur_actif1": "non", "creole.general.mode_conteneur_actif2": "non", "creole.general.mode_conteneur_actif3": "oui"}

View File

@ -1,16 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints>
<check name="valid_differ" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<check name="valid_differ" probe="False" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif1</param>
</check>
<check name="valid_differ" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<check name="valid_differ" probe="False" target="creole.general.mode_conteneur_actif3" transitive="True" warnings_only="False">
<param type="eole">creole.general.mode_conteneur_actif2</param>
</check>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "oui", "creole.general.adresse_ip_eth0": null, "creole.general.adresse_netmask_eth0": null}

View File

@ -1,13 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints>
<check name="valid_ipnetmask" target="creole.general.adresse_netmask_eth0" transitive="True" warnings_only="True">
<check name="valid_ipnetmask" probe="False" target="creole.general.adresse_netmask_eth0" transitive="True" warnings_only="True">
<param type="eole">creole.general.adresse_ip_eth0</param>
</check>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>basic</property>
<family hidden="False" mode="basic" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -1 +0,0 @@
{"creole.general.condition": "non", "creole.general.mode_conteneur_actif": "non", "creole.general.mode_conteneur_actif2": "non"}

View File

@ -1,9 +1,14 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="disabled_if_in" source="creole.general.condition">
<param hidden="True" type="string">oui</param>
<target type="variable">creole.general.mode_conteneur_actif</target>
<target type="variable">creole.general.mode_conteneur_actif2</target>
</condition>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -16,7 +21,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
@ -24,7 +28,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
</family>

View File

@ -1 +0,0 @@
{"creole.general.condition": "non", "creole.general.mode_conteneur_actif": "non", "creole.general.mode_conteneur_actif2": "non"}

View File

@ -1,9 +1,14 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="disabled_if_in" source="creole.general.condition">
<param hidden="True" type="string"/>
<target type="variable">creole.general.mode_conteneur_actif</target>
<target type="variable">creole.general.mode_conteneur_actif2</target>
</condition>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="condition" type="string">
<property>mandatory</property>
<property>normal</property>
@ -14,7 +19,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property inverse="False" source="creole.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
@ -22,7 +26,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property inverse="False" source="creole.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
</family>

View File

@ -1 +0,0 @@
{"creole.general.condition": "non", "creole.general.mode_conteneur_actif": "non", "creole.general.mode_conteneur_actif2": "non"}

View File

@ -1,9 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="disabled_if_in" source="creole.general.condition">
<param hidden="True" type="string">oui</param>
<target type="variable">creole.general.mode_conteneur_actif</target>
<target type="variable">creole.general.mode_conteneur_actif2</target>
<target type="family">creole.general2</target>
</condition>
</constraints>
<family doc="" name="creole">
<family doc="Général" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="Général" name="general">
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -16,7 +22,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
@ -24,13 +29,10 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
</family>
<family doc="Général2" name="general2">
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">disabled</property>
<family hidden="False" mode="normal" doc="Général2" name="general2">
<variable doc="No change" multi="False" name="mode_conteneur_actif3" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -1 +0,0 @@
{"creole.general.condition": "non", "creole.general.mode_conteneur_actif2": "non"}

View File

@ -1,9 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="disabled_if_in" source="creole.general.condition">
<param hidden="True" type="string">oui</param>
<target type="variable">creole.general.mode_conteneur_actif2</target>
</condition>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -24,7 +28,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
</family>

View File

@ -1 +0,0 @@
{"creole.general.condition": "non", "creole.general.mode_conteneur_actif": "non", "creole.general.mode_conteneur_actif2": "non"}

View File

@ -1,9 +1,14 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="disabled_if_in" source="creole.general.condition">
<param hidden="True" type="string">oui</param>
<target type="variable">creole.general.mode_conteneur_actif</target>
<target type="variable">creole.general.mode_conteneur_actif2</target>
</condition>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -16,7 +21,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
@ -24,7 +28,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">disabled</property>
<value type="string">non</value>
</variable>
</family>

View File

@ -1 +0,0 @@
{"creole.general.condition": "non", "creole.general.mode_conteneur_actif": "non", "creole.general.mode_conteneur_actif2": "non"}

View File

@ -1,9 +1,14 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="frozen_if_in" source="creole.general.condition">
<param hidden="True" type="string">oui</param>
<target type="variable">creole.general.mode_conteneur_actif</target>
<target type="variable">creole.general.mode_conteneur_actif2</target>
</condition>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -16,9 +21,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
@ -26,9 +28,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value>
</variable>
</family>

View File

@ -1 +0,0 @@
{"creole.general.condition": "non", "creole.general.mode_conteneur_actif": null, "creole.general.mode_conteneur_actif2": "non"}

View File

@ -1,9 +1,17 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="frozen_if_in" source="creole.general.condition">
<param hidden="True" type="string">oui</param>
<target type="variable">creole.general.mode_conteneur_actif</target>
<target type="variable">creole.general.mode_conteneur_actif2</target>
</condition>
<fill name="calc_val" target="creole.general.mode_conteneur_actif">
<param hidden="True" type="string">non</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -16,21 +24,12 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">force_default_on_freeze</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="string">non</param>
</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">frozen</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">hidden</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value>
</variable>
</family>

View File

@ -1 +0,0 @@
{"creole.general.condition": "tous"}

View File

@ -1,9 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="frozen_if_in" source="creole.general.condition">
<param hidden="True" type="string">tous</param>
<param hidden="True" type="string">authentifié</param>
<target type="variable">creole.general.mode_conteneur_actif</target>
<target type="variable">creole.general.mode_conteneur_actif2</target>
</condition>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">tous</choice>
<choice type="string">authentifié</choice>
@ -17,12 +23,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="tous" inverse="False" source="creole.general.condition" type="calculation">frozen</property>
<property expected="tous" inverse="False" source="creole.general.condition" type="calculation">hidden</property>
<property expected="tous" inverse="False" source="creole.general.condition" type="calculation">force_default_on_freeze</property>
<property expected="authentifié" inverse="False" source="creole.general.condition" type="calculation">frozen</property>
<property expected="authentifié" inverse="False" source="creole.general.condition" type="calculation">hidden</property>
<property expected="authentifié" inverse="False" source="creole.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
@ -30,12 +30,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="tous" inverse="False" source="creole.general.condition" type="calculation">frozen</property>
<property expected="tous" inverse="False" source="creole.general.condition" type="calculation">hidden</property>
<property expected="tous" inverse="False" source="creole.general.condition" type="calculation">force_default_on_freeze</property>
<property expected="authentifié" inverse="False" source="creole.general.condition" type="calculation">frozen</property>
<property expected="authentifié" inverse="False" source="creole.general.condition" type="calculation">hidden</property>
<property expected="authentifié" inverse="False" source="creole.general.condition" type="calculation">force_default_on_freeze</property>
<value type="string">non</value>
</variable>
</family>

View File

@ -1 +0,0 @@
{"creole.general.condition": "tous"}

View File

@ -1,9 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">tous</choice>
<choice type="string">authentifié</choice>

View File

@ -1 +0,0 @@
{"creole.general.condition": "non", "creole.general.mode_conteneur_actif": "non", "creole.general.mode_conteneur_actif2": "non"}

View File

@ -1,9 +1,14 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<condition name="mandatory_if_in" source="creole.general.condition">
<param hidden="True" type="string">oui</param>
<target type="variable">creole.general.mode_conteneur_actif</target>
<target type="variable">creole.general.mode_conteneur_actif2</target>
</condition>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="condition" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -16,7 +21,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">mandatory</property>
<value type="string">non</value>
</variable>
<variable doc="No change" multi="False" name="mode_conteneur_actif2" type="choice">
@ -24,7 +28,6 @@
<choice type="string">non</choice>
<property>mandatory</property>
<property>normal</property>
<property expected="oui" inverse="False" source="creole.general.condition" type="calculation">mandatory</property>
<value type="string">non</value>
</variable>
</family>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "non", "creole.general1.master.master": [], "creole.general1.master.slave1": [], "creole.general1.master.slave2": []}

View File

@ -1,9 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general1.master.slave1">
<param hidden="True" name="valeur" type="string">valfill</param>
</fill>
<fill name="calc_val" target="creole.general1.master.slave2">
<param hidden="True" type="eole">creole.general1.master.slave1</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -12,22 +18,16 @@
<value type="string">non</value>
</variable>
</family>
<family doc="general1" name="general1">
<property>normal</property>
<leader doc="master" name="master">
<property>normal</property>
<variable doc="master" multi="True" name="master" type="string"/>
<family hidden="False" mode="normal" doc="general1" name="general1">
<leader doc="master" mode="normal" name="master">
<variable doc="master" multi="True" name="master" type="string">
<property>normal</property>
</variable>
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general1.master.slave1</param>
</value>
</variable>
</leader>
</family>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": ["non"], "creole.general.master.master": [], "creole.general.master.slave1": [], "creole.general.master.slave2": []}

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="master" multi="True" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -11,9 +10,10 @@
<property>normal</property>
<value type="string">non</value>
</variable>
<leader doc="master" name="master">
<property>normal</property>
<variable doc="master" multi="True" name="master" type="string"/>
<leader doc="master" mode="normal" name="master">
<variable doc="master" multi="True" name="master" type="string">
<property>normal</property>
</variable>
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>mandatory</property>
<property>normal</property>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": ["non"], "creole.general.master.master": ["value"], "creole.general.master.slave1": [null], "creole.general.master.slave2": [null]}

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="master" multi="True" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -11,10 +10,10 @@
<property>normal</property>
<value type="string">non</value>
</variable>
<leader doc="master" name="master">
<property>normal</property>
<leader doc="master" mode="normal" name="master">
<variable doc="master" multi="True" name="master" type="string">
<property>mandatory</property>
<property>normal</property>
<value>value</value>
</variable>
<variable doc="slave1" multi="True" name="slave1" type="string">

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "non", "creole.general_1.master.master": [], "creole.general_1.master.slave1": [], "creole.general_1.master.slave2": []}

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -12,12 +11,11 @@
<value type="string">non</value>
</variable>
</family>
<family doc="general-1" name="general_1">
<property>basic</property>
<leader doc="master" name="master">
<property>basic</property>
<family hidden="False" mode="basic" doc="general-1" name="general_1">
<leader doc="master" mode="basic" name="master">
<variable doc="master" multi="True" name="master" type="string">
<property>mandatory</property>
<property>basic</property>
</variable>
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>normal</property>

View File

@ -2,8 +2,7 @@
<creole>
<constraints/>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="True" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "non", "creole.general.master.master": [], "creole.general.master.slave1": [], "creole.general.master.slave2": []}

View File

@ -1,9 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general.master.slave1">
<param hidden="True" name="valeur" type="string">valfill</param>
</fill>
<fill name="calc_val" target="creole.general.master.slave2">
<param hidden="True" type="eole">creole.general.master.slave1</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -11,20 +17,15 @@
<property>normal</property>
<value type="string">non</value>
</variable>
<leader doc="master" name="master">
<property>normal</property>
<variable doc="master" multi="True" name="master" type="string"/>
<leader doc="master" mode="normal" name="master">
<variable doc="master" multi="True" name="master" type="string">
<property>normal</property>
</variable>
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
<property>expert</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.master.slave1</param>
</value>
</variable>
</leader>
</family>

View File

@ -1 +0,0 @@
{"creole.general.mode_conteneur_actif": "non", "creole.general.master.master": [], "creole.general.master.slave1": [], "creole.general.master.slave2": []}

View File

@ -1,9 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<creole>
<constraints/>
<constraints>
<fill name="calc_val" target="creole.general.master.slave1">
<param hidden="True" name="valeur" type="string">valfill</param>
</fill>
<fill name="calc_val" target="creole.general.master.slave2">
<param hidden="True" type="eole">creole.general.master.slave1</param>
</fill>
</constraints>
<family doc="" name="creole">
<family doc="general" name="general">
<property>normal</property>
<family hidden="False" mode="normal" doc="general" name="general">
<variable doc="No change" multi="False" name="mode_conteneur_actif" type="choice">
<choice type="string">oui</choice>
<choice type="string">non</choice>
@ -11,21 +17,16 @@
<property>normal</property>
<value type="string">non</value>
</variable>
<leader doc="master" name="master">
<property>normal</property>
<variable doc="master" multi="True" name="master" type="string"/>
<leader doc="master" mode="normal" name="master">
<variable doc="master" multi="True" name="master" type="string">
<property>normal</property>
</variable>
<variable doc="slave1" multi="True" name="slave1" type="string">
<property>mandatory</property>
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" name="valeur" type="string">valfill</param>
</value>
</variable>
<variable doc="slave2" multi="True" name="slave2" type="string">
<property>normal</property>
<value name="calc_val" type="calculation">
<param hidden="True" type="eole">creole.general.master.slave1</param>
</value>
</variable>
</leader>
</family>

View File

@ -1 +0,0 @@
{"creole.general.nut_monitor_netmask.nut_monitor_netmask": [], "creole.general.nut_monitor_netmask.nut_monitor_host": []}

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