Connection class constructor modifies supplied os_options

Bug #1488070 reported by Alistair Coles
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
Fix Released
Undecided
Unassigned

Bug Description

When a caller passes an os_options dict to the Connection class
constructor, the constructor may modify the os_options dict,
which can surprise the caller if they re-use the os_options
dict. Specifically the os_options tenant_name and object_storage_url
may be modified, and the changed values would then leak through to a
subsequent Connection constructed using the same os_options dict.

clayg (clay-gerrard)
Changed in python-swiftclient:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-swiftclient (master)

Reviewed: https://review.openstack.org/216240
Committed: https://git.openstack.org/cgit/openstack/python-swiftclient/commit/?id=4b310083dfebe8c54e599fe319f801cca87f8dd6
Submitter: Jenkins
Branch: master

commit 4b310083dfebe8c54e599fe319f801cca87f8dd6
Author: Alistair Coles <email address hidden>
Date: Mon Aug 24 12:34:45 2015 +0100

    Stop Connection class modifying os_options parameter

    When a caller passes an os_options dict to the Connection class
    constructor, the constructor may modify the os_options dict,
    which can surprise the caller if they re-use the os_options
    dict. Specifically the os_options tenant_name and object_storage_url
    may be modified, and the changed values would then leak through to a
    subsequent Connection constructed using the same os_options dict.

    This fix simply constructs a new dict from the supplied os_options.
    The patch also adds a test that covers this and also verifies that
    a preauth_url passed as a keyword arg to Connection() will take
    precedence over any object_storage_url in an os_options parameter.

    Closes-Bug: 1488070
    Change-Id: Ic6b5cf3ac68c505de155619f2610be9529e15432

Changed in python-swiftclient:
status: Confirmed → Fix Committed
Changed in python-swiftclient:
milestone: none → 2.6.0
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-swiftclient 2.6.0

This issue was fixed in the openstack/python-swiftclient 2.6.0 release.

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.