Comment 9 for bug 1736920

Revision history for this message
Stephen Finucane (stephenfinucane) wrote :

I finally got around to investigating this today. tl;dr: there does not appear to be an issue here.

The return value of 'glanceclient.Client.images.data' is 'glanceclient.common.utils.RequestIdProxy', owing to the use of the 'add_req_id_to_object' decorator [2]. This is *not* a generator, which means the 'inspect.isgenerator' conditional at [1] is False and we will never convert these large images to a list. In fact, there appears to be only one case that does trigger this: the 'glanceclient.Client.images.list' case, which returns a 'glanceclient.common.utils.GeneratorProxy' object due to the use of the 'add_req_id_to_generator' decorator. This is the function at the root of bug #1557584. As such, the fix is correct and there's nothing to do here besides possibly documenting things better in the code.

[1] https://github.com/openstack/nova/blob/16.0.0/nova/image/glance.py#L167
[2] https://github.com/openstack/python-glanceclient/blob/3.1.1/glanceclient/v2/images.py#L200
[3] https://github.com/openstack/python-glanceclient/blob/3.1.1/glanceclient/v2/images.py#L85