List Properties return None by default

Bug #1255903 reported by Steven Hardy
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Triaged
Wishlist
Unassigned

Bug Description

List properties, and probably also map, return None by default, which is inconvenient if you want to iterate over a property as you have to remember to default to an empty list either in the schema or when getting the property.

This is inconvenient and error prone, and can easily result in a 'NoneType' object is not iterable error when people forget.

It may be better, long term, to default these in the top-level Property class, Zane has suggested we need to do an audit of all existing uses of these type of properties to ensure nothing breaks.

Revision history for this message
Zane Bitter (zaneb) wrote :

Everything returns None by default.

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/59092

Changed in heat:
assignee: nobody → Stephen Gran (sgran)
status: New → In Progress
Revision history for this message
Angus Salkeld (asalkeld) wrote :
Changed in heat:
assignee: Stephen Gran (sgran) → nobody
importance: Undecided → Wishlist
status: In Progress → Triaged
Changed in heat:
assignee: nobody → pradeep kumar singh (pradeep-singh-u)
Revision history for this message
Pradeep Kumar Singh (pradeep-singh-u) wrote :

Hi Angus,

I think this issue does not exists any more, am i right?

Revision history for this message
Zane Bitter (zaneb) wrote :

Yeah, it looks to me like the change in comment #3 would have resolved this. Hopefully it didn't break too much stuff...

Changed in heat:
assignee: Pradeep Kumar Singh (pradeep-singh-u) → nobody
Rico Lin (rico-lin)
Changed in heat:
milestone: none → no-priority-tag-bugs
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.