[openstack-dev] [Mistral] Changing "expression" delimiters in Mistral DSL

Dmitri Zimine dzimine at stackstorm.com
Wed Feb 18 17:10:15 UTC 2015


Zane, Angus, thanks for your input!

This functional based syntax is consisted for dev use. The trouble is it ITSELF needs to be delimited. Without pissing off the users :) Consider two key usage:  input parameters and shorthand syntax for action input. That’s why we are looking for two-char symmetric (opening + closing) delimiters. 

task_with_full_syntax_input:
  action: std.ssh
  input: 
     cmd = awk '{ print "<% $.my_var %>" }' /etc/passwd

task_with_shorthand_action_input:
  action: std.ssh cmd="awk '{ print \”<% $.my_var %>\" }' /etc/passwd”

using function-like we still will have to do 
  action: std.ssh cmd=“awk '{ print \”<% yaql {$.my_var} %>\" }' /etc/passwd”
that only adds confusion IMO. 

The full set of usages for YAQL in DSL is here: https://etherpad.openstack.org/p/mistral-YAQL-delimiters

DZ. 

On Feb 18, 2015, at 7:22 AM, Zane Bitter <zbitter at redhat.com> wrote:

> On 16/02/15 16:06, Dmitri Zimine wrote:
>> 2) Use functions, like Heat HOT or TOSCA:
>> 
>> HOT templates and TOSCA doesn’t seem to have a concept of typed
>> variables to borrow from (please correct me if I missed it). But they
>> have functions: function: { function_name: {foo: [parameter1, parameter
>> 2], bar:"xxx”}}. Applied to Mistral, it would look like:
>> 
>>     publish:
>>      - bool_var: { yaql: “1+1+$.my.var < 100” }
>> 
>> Not bad, but currently rejected as it reads worse than delimiter-based
>> syntax, especially in simplified one-line action invocation.
> 
> Note that you don't actually need the quotes there, so this would be equivalent:
> 
>    publish:
>     - bool_var: {yaql: 1+1+$.my.var < 100}
> 
> FWIW I am partial to this or to Renat's p7 suggestion:
> 
>    publish:
>     - bool_var: yaql{1+1+$.my.var < 100}
> 
> Both offer the flexibility to introduce new syntax in the future without breaking backwards compatibility.
> 
> cheers,
> Zane.
> 
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150218/12cc5a95/attachment.html>


More information about the OpenStack-dev mailing list