swiftclient.client.HTTPConnection not iterable, problems in function calls

Bug #1322053 reported by Benedikt von St. Vieth
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
New
Undecided
Unassigned

Bug Description

Hi,
while implementing against the swiftclient python lib i faced a problem:

http_connection = swiftclient.client.HTTPConnection('[url]')
swiftclient.client.put_container([url], [token], [container], http_conn=http_connection)

First, why is it required to give a url to put_container when i want to give a existing HTTPConnection object to it?
Second, and thats the bug (i would say), HTTPConnection is not iterable, therefore code sections like
    if http_conn:
        parsed, conn = http_conn
which occur in the swiftclient.client.py quite often, fail, at least in my case with python 2.7.5.

I think because of a lack of test-coverage (always a url is given) this does not show up during running the tests.

Is this a bug or is it a wrong usage of the swiftclient? If its a bug i can try to fix it.

Revision history for this message
Alistair Coles (alistair-coles) wrote :

Could you provide more details of the failure you see using:
if http_conn:
        parsed, conn = http_conn

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.