SwiftService.post ignores SwiftPostObject options['header']

Bug #1560052 reported by Marek Kaleta
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
Fix Released
Undecided
Marek Kaleta

Bug Description

swift either ignores 'header' item or raises KeyError on 'headers'

swift = SwiftService(options=options)

swift.post('post_test', [SwiftPostObject(object_name='post_test',
                    options={ 'header':['Content-Type:apllication/octet-stream']})])
# does not send header

swift.post('post_test', [SwiftPostObject(object_name='post_test',
                    options={ 'headers':['Content-Type:apllication/octet-stream']})])
#Traceback (most recent call last):
# File "test.py", line 46, in <module>
# 'headers':['Content-Type:apllication/octet-stream'],
# File "/home/swift/python-swiftclient/swiftclient/service.py", line 708, in post
# split_headers(obj_options['header'], '')
#KeyError: u'header'

Easy to fix:
http://git.openstack.org/cgit/openstack/python-swiftclient/tree/swiftclient/service.py#n706

Changed in python-swiftclient:
assignee: nobody → Marek Kaleta (marek-kaleta)
information type: Public → Public Security
information type: Public Security → Private Security
information type: Private Security → Public
Changed in python-swiftclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-swiftclient (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-swiftclient (master)

Reviewed: https://review.openstack.org/296382
Committed: https://git.openstack.org/cgit/openstack/python-swiftclient/commit/?id=51a8a5a7ae3a065307974791ed1dd43503fb3b5a
Submitter: Jenkins
Branch: master

commit 51a8a5a7ae3a065307974791ed1dd43503fb3b5a
Author: Marek Kaleta <email address hidden>
Date: Wed Mar 23 12:09:49 2016 +0100

    Fix SwiftPostObject options usage in SwiftService

    SwiftService().post(cont, [SwiftPostObject(obj, options]) currently
    ignores options['header'], raises exception when options['headers']
    is set and make malformed metadata when options['meta'] is set.

    Fix tipos in code, add unittest for SwiftService().post
    Closes-Bug: #1560052

    Change-Id: Ie460f753492e9b73836b4adfc7c9c0f2130a8a91

Changed in python-swiftclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-swiftclient 3.1.0

This issue was fixed in the openstack/python-swiftclient 3.1.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.