Parse error/NoMatchingFunctionException when using minus sign in a heat template

Bug #1520954 reported by Tomer Shtilman
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
High
Stan Lagun
Kilo
Won't Fix
High
Stan Lagun
Liberty
Fix Released
High
Stan Lagun
Mitaka
Fix Released
High
Stan Lagun

Bug Description

when we are using minus sign in a heat template output field name we have encountered the following problems
1.when the word "in" is following a - we get 'Parse error: unexpected 'in' at position 26 of expression '$.tier-alarm-status-scale-in''.
2.when we use "in*" word after the minus sign we get [yaql.language.exceptions.NoMatchingFunctionException]: No function "#operator_-" matches supplied arguments'

we have isolated the issue into simple templates below

#OK

heat_template_version: '2014-10-16'
outputs:
  tier_alarm_status_scale_in:
    description: null
    value:
      get_attr: [server, first_address]
parameters:
  flavor:
    constraints:
    - {custom_constraint: nova.flavor}
    default: LARGE_1
    type: string
  image:
    constraints:
    - {custom_constraint: glance.image}
    default: centos-6-web-v1
    type: string
  network:
    constraints:
    - {custom_constraint: neutron.network}
    default: PUBLIC_NET_NODE_A
    type: string
resources:
  server:
    properties:
      flavor: {get_param: flavor}
      image: {get_param: image}
      name: server1
      networks:
      - network: {get_param: network}
    type: OS::Nova::Server

#OK
heat_template_version: '2014-10-16'
outputs:
  tier-alarm-status-scale-tomer:
    description: null
    value:
      get_attr: [server, first_address]
parameters:
  flavor:
    constraints:
    - {custom_constraint: nova.flavor}
    default: LARGE_1
    type: string
  image:
    constraints:
    - {custom_constraint: glance.image}
    default: centos-6-web-v1
    type: string
  network:
    constraints:
    - {custom_constraint: neutron.network}
    default: PUBLIC_NET_NODE_A
    type: string
resources:
  server:
    properties:
      flavor: {get_param: flavor}
      image: {get_param: image}
      name: server1
      networks:
      - network: {get_param: network}
    type: OS::Nova::Server

#FAILS 'Parse error: unexpected 'in' at position 26 of expression '$.tier-alarm-status-scale-in''.
heat_template_version: '2014-10-16'
outputs:
  tier-alarm-status-scale-in:
    description: null
    value:
      get_attr: [server, first_address]
parameters:
  flavor:
    constraints:
    - {custom_constraint: nova.flavor}
    default: LARGE_1
    type: string
  image:
    constraints:
    - {custom_constraint: glance.image}
    default: centos-6-web-v1
    type: string
  network:
    constraints:
    - {custom_constraint: neutron.network}
    default: PUBLIC_NET_NODE_A
    type: string
resources:
  server:
    properties:
      flavor: {get_param: flavor}
      image: {get_param: image}
      name: server1
      networks:
      - network: {get_param: network}
    type: OS::Nova::Server

#FAILS [yaql.language.exceptions.NoMatchingFunctionException]: No function "#operator_-" matches supplied arguments'
heat_template_version: '2014-10-16'
outputs:
  tier-alarm-status-scale-into:
    description: null
    value:
      get_attr: [server, first_address]
parameters:
  flavor:
    constraints:
    - {custom_constraint: nova.flavor}
    default: LARGE_1
    type: string
  image:
    constraints:
    - {custom_constraint: glance.image}
    default: centos-6-web-v1
    type: string
  network:
    constraints:
    - {custom_constraint: neutron.network}
    default: PUBLIC_NET_NODE_A
    type: string
resources:
  server:
    properties:
      flavor: {get_param: flavor}
      image: {get_param: image}
      name: server1
      networks:
      - network: {get_param: network}
    type: OS::Nova::Server

summary: - problems when using minus sign in a heat template
+ Parse error/NoMatchingFunctionException when using minus sign in a heat
+ template
Revision history for this message
Tomer Shtilman (tomer-shtilman) wrote :
Revision history for this message
Tomer Shtilman (tomer-shtilman) wrote :
Stan Lagun (slagun)
Changed in murano:
importance: Undecided → High
milestone: none → mitaka-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

Fix proposed to branch: master
Review: https://review.openstack.org/252307

Changed in murano:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/252893

Revision history for this message
Stan Lagun (slagun) wrote :

In Kilo there is no templateParameters property and all HOT inputs are converted to MuranoPL properties (where name constraints apply). So there is no point to not to do the same for outputs

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/252307
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=6f013c57228e697ccb9769f2e841fa454714ad10
Submitter: Jenkins
Branch: master

commit 6f013c57228e697ccb9769f2e841fa454714ad10
Author: Stan Lagun <email address hidden>
Date: Wed Dec 2 12:43:44 2015 +0300

    HOT outputs were merged

    This commit does dot HOT template outputs (for Heat.HOT/1.0 format)
    the same that was previously done for the inputs. Instead of generating
    MuranoPL property per each output now all outputs are put into a
    single 'templateOutputs' property. This allows to eliminate the constraints
    on output names, not to have collisions with input names and remain
    consistent with previous changes.

    Change-Id: Ibbd0a2f410c55385cd3cb9e85ea135a36460afe7
    Closes-Bug: #1520954

Changed in murano:
status: In Progress → Fix Committed
Changed in murano:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (stable/liberty)

Reviewed: https://review.openstack.org/252893
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=c41624e1eb339c00c8e273013324505b904ee8e2
Submitter: Jenkins
Branch: stable/liberty

commit c41624e1eb339c00c8e273013324505b904ee8e2
Author: Stan Lagun <email address hidden>
Date: Wed Dec 2 12:43:44 2015 +0300

    HOT outputs were merged

    This commit does dot HOT template outputs (for Heat.HOT/1.0 format)
    the same that was previously done for the inputs. Instead of generating
    MuranoPL property per each output now all outputs are put into a
    single 'templateOutputs' property. This allows to eliminate the constraints
    on output names, not to have collisions with input names and remain
    consistent with previous changes.

    Change-Id: Ibbd0a2f410c55385cd3cb9e85ea135a36460afe7
    Closes-Bug: #1520954

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.