swiftclient download --output to stdout doesn't work
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
Changed in swift: | |
status: | New → In Progress |
assignee: | nobody → Christian Schwede (cschwede) |
Changed in swift: | |
status: | In Progress → Fix Released |
Looks like this is being handled over here:
https:/ /bugs.launchpad .net/python- swiftclient/ +bug/1399256