Comment 11 for bug 1808063

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to glance (master)

Reviewed: https://review.openstack.org/625114
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=deffb09871c9460497929c57bd82ca78d1c3177f
Submitter: Zuul
Branch: master

commit deffb09871c9460497929c57bd82ca78d1c3177f
Author: Chris Dent <email address hidden>
Date: Thu Dec 13 20:56:39 2018 +0000

    Make QuotaImageTagsProxy deep-copyable

    Infinite recursion is possible if you try to deepcopy a
    QuotaImageTagsProxy object, which is something that happens when using
    oslo.policy 1.43.1 and beyond.

    By adding a __gettattribute__ within the __getattr__ method we can break
    the loop when the name of the attribute is 'tags'.

    The added test will fail (with infinite recursion) if the new code is
    removed.

    For completeness a test is added checking what happens when the tags
    attribute is removed.

    The thing that is not immediately clear from the __getattr__ code is
    that it is not for getting at the tags themselves, it is for getting
    at the methods on the set object at self.tags. The non-obviousness
    of this led to rather a lot of confusion while trying to get this
    code right. It isn't really "right" now, but rather: safe in the
    context of its use.

    Change-Id: Ic47c9bf8e9b97de5a5a49a35f631753c54e0e2af
    Related-Bug: #1808063