Need resource.prop resource list class

Bug #1423620 reported by Terry Howe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack SDK
Confirmed
High
Unassigned

Bug Description

SecurityGroup has a list of SecurityGroupRule. There is a kludge in the __init__ to convert the dicts into SecurityGroupRules. If there was a special resource list property with type=SecurityGroupRule that wouldn't need to be there.

Tags: resource
Revision history for this message
Brian Curtin (brian.curtin) wrote :

Take a look at what's done in https://review.openstack.org/#/c/155995/6/openstack/compute/v2/limits.py to see if that'll work

We're going to have to do the type conversion somewhere, and I think it makes the most sense to unserialize as early as possible when that type is going to come into play, which would be an overridden get call. I think that approach also lines up with how https://review.openstack.org/#/c/157183/2/openstack/resource.py is proposed - we keep everything as-is until we need to serialize at the last second.

This is also how you'd do something like unicode/bytes conversion - as close as possible to the boundaries of your application.

I don't think we should have any special type to signify the list itself is special. It's Python so a list is a list and we should just document that it contains values we created of a certain type but not go any further. It really only matters on the receiving side of things that we're creating the right types for the list members.

Changed in python-openstacksdk:
status: New → Confirmed
Changed in python-openstacksdk:
importance: Undecided → High
milestone: none → 1.0
Revision history for this message
Terry Howe (thowe-g) wrote :

Sounds good

tags: added: resource
Changed in python-openstacksdk:
milestone: 1.0 → 1.1
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.