swiftclient download --output to stdout doesn't work

Bug #1387376 reported by clayg
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Christian Schwede

Bug Description

The swift commnad line client's download command has an --output option to change the name of the downloaded object when it's written to disk, the help message also describes the ability to set the --output/out_file option to the literal string value '-' to specify that ouptut should be written to stdout.

It doesn't work though. It used to.

The SwiftService class is yielding out the response before reading it, but after entering the _SwiftReader context manager who validates that all bytes were read against the content_length on exit.

I think there's a general capability we could add to SwiftService that allows it to yield out the unopened SwiftReaders in the case where the caller wants to handle download/reading the HTTP response (e.g. write data back out to another socket w/o touching slow disk) - but there may be a quicker solution to just getting the '-' option working which requires only a single object download request.

Here's what it looks like now:

$ swift download test test -o -
Error downloading object 'test/test': 'Error downloading test: read_length != content_length, 0 != 8'

It should look more like:

$ swift download test test -o -
awesome

Tags: swiftclient
Revision history for this message
clayg (clay-gerrard) wrote :
Revision history for this message
clayg (clay-gerrard) wrote :

Looks like this is being handled over here:

https://bugs.launchpad.net/python-swiftclient/+bug/1399256

Changed in swift:
status: New → In Progress
assignee: nobody → Christian Schwede (cschwede)
Revision history for this message
Joel Wright (joel-wright-k) wrote :

New python 3.x compatible fix proposed (sorry, I didn't see the previous chain of bug reports before I dived in to fix this!).
Review: https://review.openstack.org/144899

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

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