Connection class constructor modifies supplied os_options
Bug #1488070 reported by
Alistair Coles
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.
Changed in python-swiftclient: | |
status: | New → Confirmed |
Changed in python-swiftclient: | |
milestone: | none → 2.6.0 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/216240 /git.openstack. org/cgit/ openstack/ python- swiftclient/ commit/ ?id=4b310083dfe be8c54e599fe319 f801cca87f8dd6
Committed: https:/
Submitter: Jenkins
Branch: master
commit 4b310083dfebe8c 54e599fe319f801 cca87f8dd6
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 5de155619f2610b e9529e15432
Change-Id: Ic6b5cf3ac68c50