heat API returns NoEcho value as a string instead of a boolean
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 |
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