deepcopy of ATTR_NOT_SPECIFIED creates new object

Bug #1577571 reported by Brandon Logan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Brandon Logan

Bug Description

ATTR_NOT_SPECIFIED is meant to be a constant value, but since it is just an instance of an object(), doing a copy.deepcopy of it will create a new instantiation of object.

Tags: api
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lib (master)

Fix proposed to branch: master
Review: https://review.openstack.org/311858

Changed in neutron:
status: New → In Progress
Ryan Moats (rmoats)
Changed in neutron:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lib (master)

Reviewed: https://review.openstack.org/311858
Committed: https://git.openstack.org/cgit/openstack/neutron-lib/commit/?id=d33b62b0e785d09ae59b14e18fd183bd7d2fb206
Submitter: Jenkins
Branch: master

commit d33b62b0e785d09ae59b14e18fd183bd7d2fb206
Author: Brandon Logan <email address hidden>
Date: Mon May 2 16:12:59 2016 -0500

    Maintain ATTR_NOT_SPECIFIED constant with deepcopy

    ATTR_NOT_SPECIFIED needs to always remain the same value, but
    deepcopy will instantiate a new object() if it encounters
    ATTR_NOT_SPECIFIED. This ensures any deepcopy of a dict that
    includes ATTR_NOT_SPECIFIED will always return the same instantiation
    of object.

    Change-Id: I9685dfff24e36992e90919bd7c2be2cda6c075f3
    Closes-Bug: #1577571
    Co-Authored-By: Kevin Benton <email address hidden>

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron-lib 0.2.0

This issue was fixed in the openstack/neutron-lib 0.2.0 release.

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

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/800682

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/800682
Committed: https://opendev.org/openstack/neutron/commit/1eabf046f3f6d25c8cf380a0c5e219f4f905b8e7
Submitter: "Zuul (22348)"
Branch: master

commit 1eabf046f3f6d25c8cf380a0c5e219f4f905b8e7
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Tue Jul 13 16:24:12 2021 +0000

    Remove "_protect_original_resources" workaround

    Fix in neutron-lib was merged in [1]. We can now remove the
    workaround implemented.

    Related-Bug: #1577571

    [1]https://review.opendev.org/c/openstack/neutron-lib/+/311858

    Change-Id: I3092659882b966745839611c848523171697bc9a

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.