Input inline syntax does not escape "=" symbol
Bug #1401039 reported by
Nikolay Makhotkin
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mistral |
Fix Released
|
Medium
|
Nikolay Makhotkin |
Bug Description
Steps to reproduce:
1. Create workflow containing task with following action:
action: std.http url="http://
2. Get error of parsing arguments: "List index out of range in 'parse_
Changed in mistral: | |
assignee: | nobody → Nikolay Makhotkin (nmakhotkin) |
Changed in mistral: | |
status: | In Progress → Fix Committed |
Changed in mistral: | |
status: | Fix Committed → Fix Released |
Changed in mistral: | |
milestone: | kilo-1 → 2015.1 |
To post a comment you must log in.
I added some debug print statements and figured out that the bug is caused by this regular expression that is used to split the command string in action into key value pairs.
If you look at this, if there is a '=' sign inside a value, then mistral blows up. For example action: std.echo output= 'lakshmi= test' would break.
('Cmd_str: %s, PARAMS_PTRN: %s', u'std.echo output="Morpheus"', <_sre.SRE_Pattern object at 0x7fad52d743d0>) google. com/query? q={$.query}\'"', <_sre.SRE_Pattern object at 0x7fad52d743d0>) google. com/query? q={$.query}\'"', <_sre.SRE_Pattern object at 0x7fad52d743d0>)
('Key: %s, Value: %s', u'output', u'"Morpheus"')
('Cmd_str: %s, PARAMS_PTRN: %s', u'std.echo output="\'http://
('Key: %s, Value: %s', u'output', u'')
('Cmd_str: %s, PARAMS_PTRN: %s', u'std.echo output="\'http://
('Key: %s, Value: %s', u'q', u'{$.query}')
}}}
I really think regular expression is not the way to parse the string. I would write a simple lexer that splits based on ' ' (space) first and for each of the strings that is not the action name, split based on first '=' that you encounter in the string. I can write some sample code in my free time to show what I am talking about. I just wanted to post my debug logs in case someone else is looking into fixing it.