heat API returns NoEcho value as a string instead of a boolean

Bug #1364507 reported by Miguel Grinberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Triaged
Wishlist
Miguel Grinberg

Bug Description

When validating a template, the heat API returns the "NoEcho" property of template parameters as a string, with values "true" or "false".

But for a client it is odd to have to check this property as a string, and is also error prone, since most people will assume this property comes as a boolean. This happened to me when I was implementing this property on Horizon. I did not realize there were quotes around "true" and "false" in the JSON responses in the log until I went with a debugger to inspect why my comparisons were not working right.

Would there be opposition if the API is changed to return proper JSON boolean for this property? Horizon currently does not use this property at all, so no problems there. I guess the only risk is with other clients, if there are any.

Changed in heat:
assignee: nobody → Miguel Grinberg (miguelgrinberg)
description: updated
description: updated
Revision history for this message
Steven Hardy (shardy) wrote :

This is probably a historical mistake, but we can't just change the API as it may break existing users.

I'd suggest we add this to the wishlist for the v2 API:

https://wiki.openstack.org/wiki/Heat/Blueprints/V2API

https://blueprints.launchpad.net/heat/+spec/v2api

And for now, those consuming the values can use oslo bool_from_string function which should work correctly with either format:

https://github.com/openstack/oslo-incubator/blob/master/openstack/common/strutils.py#L100

Changed in heat:
status: New → Triaged
importance: Undecided → Low
milestone: none → ongoing
Revision history for this message
Qiming Teng (tengqim) wrote :

Any activities still ongoing here?

Revision history for this message
Miguel Grinberg (miguelgrinberg) wrote :

This is waiting until API v2 work picks up.

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Setting to wishlist until v2 happens

Changed in heat:
importance: Low → Wishlist
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.