ansible/ansible — pull request #7797 by jcassee (2014-06-16 22:39:12+00:00)
Title: Add overwrite=smart parameter to s3 module

Using `overwrite=smart`, the `s3` module gets or puts a file if the md5 hash is different. See the [discussion on the mailinglist](https://groups.google.com/d/topic/ansible-devel/8XiNrWrjP6M/discussion).

This PR contains three commits:

* 23bd640b240cb6d238525b014ef5f37d1ea0ec53 adds the functionality
* 2deb324ea1af7f9bfd1e4b3d4d0d8e6a1245a458 removes some trailing whitespace (so that they do not interfere with code changes)
* f9300c599cc25eda934b3bbfc3a91d65c907f3c0 refactors the code branches and conditionals, mostly;
* fast return from functions instead of nested if-statements
* `if x: return True` -> `return x`
* removal of dead code

I must admit I have not written tests for these changes, which is probably necessary as this module does a lot. I did test some extensive manual tests, though.