Merge "Refactoring inline parameters syntax"

This commit is contained in:
Jenkins 2015-02-11 15:40:56 +00:00 committed by Gerrit Code Review
commit b03477beb7
2 changed files with 18 additions and 3 deletions

View File

@ -105,7 +105,7 @@ workflows:
task7:
with-items: vm_info in $.vms
workflow: wf2 is_true=true object_list=[1, null, "str"]
workflow: wf2 is_true=true object_list=[1, null, "str"] is_string="50"
on-complete:
- task9
- task10
@ -327,6 +327,7 @@ class DSLv2ModelTest(base.BaseTest):
{
'is_true': True,
'object_list': [1, None, 'str'],
'is_string': '50'
},
task7_spec.get_input()
)

View File

@ -21,8 +21,22 @@ from mistral import exceptions as exc
CMD_PTRN = re.compile("^[\w\.]+[^=\s\"]*")
PARAMS_PTRN = re.compile("([\w]+)=(\"[^\"]*\"\s*|'[^']*'\s*|"
"\{[^}]*\}\s*|\[.*\]\s*|[\.,:\w\d\.]+)")
_ALL_IN_BRACES = "\{[^}]*\}\s*"
_ALL_IN_BRACKETS = "\[.*\]\s*"
_ALL_IN_QUOTES = "\"[^\"]*\"\s*"
_ALL_IN_APOSTROPHES = "'[^']*'\s*"
_DIGITS = "\d+"
_TRUE = "true"
_FALSE = "false"
_NULL = "null"
ALL = (
_ALL_IN_QUOTES, _ALL_IN_APOSTROPHES, _ALL_IN_BRACES,
_ALL_IN_BRACKETS, _TRUE, _FALSE, _NULL, _DIGITS
)
PARAMS_PTRN = re.compile("([\w]+)=(%s)" % "|".join(ALL))
class BaseSpec(object):