Undesired rounding float parameter

Bug #1323649 reported by Sergey Kraynev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Sergey Kraynev

Bug Description

I try to preview stack with template [1] with couple changes:

 - I added Cooldown parameter with Number type and Default float value 8.9 (it should be not unicode and not string).
 - I added Cooldown property to WebServerGroup resource, that reference on parameter Cooldown.

When I try to create this stack I will get stack, where resource WebServerGroup has property cooldown equal to 8.

The problem is here [2]. It happens because Default value has float type, instead of string (when we pass this parameter through CLI). For avoiding this problem will be better to use str_to_num method of Schema class.

[1] https://github.com/openstack/heat-templates/blob/master/cfn/F17/AutoScalingMultiAZSample.yaml
[2] https://github.com/openstack/heat/blob/master/heat/engine/parameters.py#L281

Changed in heat:
assignee: nobody → Sergey Kraynev (skraynev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/95761
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=5984910bdf927fd1242f49007f01bf09f0f8ed78
Submitter: Jenkins
Branch: master

commit 5984910bdf927fd1242f49007f01bf09f0f8ed78
Author: Sergey Kraynev <email address hidden>
Date: Tue May 27 09:02:19 2014 -0400

    Use str_to_num for Number parameter

    Current implemenation method 'value' convert all input parameters. But
    should ignore type Number, because it may round value with float type.
    Also this logic is already implemented in str_to_num method. This patch
    forces NumberParam class to use str_to_num in value method.

    Closes-Bug: #1323649

    Change-Id: I7333cb4d6641d886cffb4812ceaa58db8d86c135

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-1 → 2014.2
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.