timkay / aws

Easy command line access to Amazon EC2, S3, SQS, ELB, and SDB
http://timkay.com/aws/
424 stars 123 forks source link

aws no longer exits with non-zero code on error #26

Closed phik closed 11 years ago

phik commented 11 years ago

"aws put" routinely fails partway through uploading a file (a separate bug that I'm too lazy to diagnose), so we wrap it in a while loop. Good enough for government work.

That worked great with version 1.49, which would exit non-zero in that case. 1.75 seems to exit with rc=0 regardless of whether it succeeds or fails:

$ for a in *zip; do echo $a ; until aws-1.49 --progress --public put bucket $a ; do echo "Trying again." ; done ; done
foo.zip
###################################                                       49.7%
Trying again.
######################################################################## 100.0%
$

vs.

$ for a in *zip; do echo $a ; until aws-1.75 --progress --public put bucket $a ; do echo "Trying again." ; done ; done
foo.zip
####################################################################      94.6%
$
timkay commented 11 years ago

Sorry for the slow reply.

Try this:

aws get test681/xxx --request --expire-time=1h

You'll get a URL you can try directly with curl. If you get the wrong error (rc=0 when it shouldn't), then the problem is definitely with curl. If you find that a certain combination of curl flags works for you, let me know, and we'll update the code.