eole => variable

This commit is contained in:
2019-12-22 08:58:37 +01:00
parent 81028d1539
commit 3881cb7e98
30 changed files with 58 additions and 52 deletions

View File

@ -73,9 +73,9 @@ KEY_TYPE = {'variable': 'symlink',
'URLOption': 'web_address',
'FilenameOption': 'filename'}
TYPE_PARAM_CHECK = ('string', 'python', 'eole')
TYPE_PARAM_CONDITION = ('string', 'python', 'number', 'eole')
TYPE_PARAM_FILL = ('string', 'eole', 'number', 'context')
TYPE_PARAM_CHECK = ('string', 'python', 'eole', 'variable')
TYPE_PARAM_CONDITION = ('string', 'python', 'number', 'eole', 'variable')
TYPE_PARAM_FILL = ('string', 'eole', 'number', 'context', 'variable')
DISKNOD_KEY_TYPE = {'major': 'number',
'minor': 'number'}
@ -963,6 +963,8 @@ class SpaceAnnotator(object):
if param.type not in TYPE_PARAM_CHECK:
raise CreoleDictConsistencyError(_('cannot use {} type as a param in check for {}').format(param.type, check.target))
if param.type == 'eole':
param.type = 'variable'
if param.type == 'variable':
if HIGH_COMPATIBILITY and param.text.startswith('container_ip'):
if param.optional is True:
param_option_indexes.append(idx)
@ -1043,7 +1045,9 @@ class SpaceAnnotator(object):
'').format(check.target))
param = check.param[0]
if proposed_value_type:
if param.type != 'eole':
if param.type == 'eole':
raise Exception('hu?')
if param.type == 'variable':
try:
values = self.load_params_in_validenum(param)
except NameError as err:
@ -1142,12 +1146,13 @@ class SpaceAnnotator(object):
if param.type not in TYPE_PARAM_FILL:
raise CreoleDictConsistencyError(_('cannot use {} type as a param '
'in a fill/auto').format(param.type))
if param.type == 'eole':
param.type = 'variable'
param_option_indexes = []
for fill_idx, param in enumerate(fill.param):
if not hasattr(param, 'text') and \
(param.type == 'eole' or param.type == 'number' or \
#param.type == 'container' or param.type == 'python'):
param.type == 'python'):
(param.type == 'variable' or param.type == 'number' or \
param.type == 'python'):
raise CreoleDictConsistencyError(_("All '{}' variables shall be set in "
"order to calculate {}").format(
param.type,
@ -1155,7 +1160,7 @@ class SpaceAnnotator(object):
# if param.type == 'container':
# param.type = 'eole'
# param.text = 'container_ip_{}'.format(param.text)
if param.type == 'eole':
if param.type == 'variable':
#if is_probe:
# raise CreoleDictConsistencyError(_('Function {0} used to calculate {1} '
# 'is executed on remote server, '
@ -1347,6 +1352,8 @@ class SpaceAnnotator(object):
if param.type not in TYPE_PARAM_CONDITION:
raise CreoleDictConsistencyError(_('cannot use {} type as a param '
'in a condition').format(param.type))
if param.type == 'eole':
param.type = 'variable'
def check_choice_option_condition(self, force_remove_targets):
# remove condition for ChoiceOption that don't have param

View File

@ -404,7 +404,7 @@ class Variable(Common):
name = param.attrib.get('name', '')
if param.attrib['type'] == 'string':
value = param.text
elif param.attrib['type'] == 'eole':
elif param.attrib['type'] == 'variable':
transitive = param.attrib.get('transitive', 'False')
if transitive == 'True':
transitive = True