aws/aws-cli — pull request #523 by jamesls (2013-12-03 05:52:03+00:00)
Title: Drop requirements for ListObjects in s3 cp command

This fixes #328.

The issue is that before running an `aws s3 cp` command we verify that the src and destination argument exist. When either arg is an s3 location we verify the bucket exists. This means that for uploads/downloads we require the `ListObjects` command (what we use to verify the bucket exists), which is problematic if you're trying to create an IAM policy that does not have the `ListObjects` command. The policy in #328 would give a user the ability to download an object, but they wouldn't be able to see the contents in a bucket.

In order to fix this, a few changes were needed:

* First remove the src/dest pre-check. Now we just try the operation without checking if the resources exist.
* Make the error messages more clear. Now it's possible to have a number of errors when an operation is run. Rather than immediately stopping, we keep going (it's not guaranteed that all operations will fail, the user could have access to only a specific prefix). To accomodate this scenario, the error messages have been updated to print all on the same line, and the operation name is now included in the error message:

```
upload failed: ./file-0 to s3://test-bucket/file-0 A client error (AccessDenied) occurred when calling the PutObject operation: Access Denied
```

Also, the `filegenerator` module needed an update to not require a `ListObjects` call if we're only downloading a single file (https://github.com/jamesls/aws-cli/commit/2e7abb631f8a25241d419d3e1bb2486c4190a576). One consequence of this change is that we no longer have information about the `last_update` time for the file, which we were previously using to set the mtime of the file (so it would play nicely with subsequent `sync` operations). We're losing that information now, so the file's mtime will just be the time when the file is downloaded.