Also don't fail if files are different and overwrite is false for uploads (this mimics copy and template).

Related to #489
This commit is contained in:
Toshio Kuratomi 2015-03-11 08:59:38 -07:00 committed by Matt Clay
parent 7d16ec283e
commit ba90eea165

View file

@ -377,7 +377,7 @@ def main():
if overwrite is True: if overwrite is True:
download_s3file(module, s3, bucket, obj, dest) download_s3file(module, s3, bucket, obj, dest)
else: else:
module.exit_json(msg="WARNING: Checksums do not match. Use overwrite parameter to force download.", failed=False) module.exit_json(msg="WARNING: Checksums do not match. Use overwrite parameter to force download.")
# Firstly, if key_matches is TRUE and overwrite is not enabled, we EXIT with a helpful message. # Firstly, if key_matches is TRUE and overwrite is not enabled, we EXIT with a helpful message.
if sum_matches is True and overwrite is False: if sum_matches is True and overwrite is False:
@ -421,7 +421,7 @@ def main():
if overwrite is True: if overwrite is True:
upload_s3file(module, s3, bucket, obj, src, expiry, metadata) upload_s3file(module, s3, bucket, obj, src, expiry, metadata)
else: else:
module.exit_json(msg="WARNING: Checksums do not match. Use overwrite parameter to force upload.", failed=True) module.exit_json(msg="WARNING: Checksums do not match. Use overwrite parameter to force upload.")
# If neither exist (based on bucket existence), we can create both. # If neither exist (based on bucket existence), we can create both.
if bucketrtn is False and pathrtn is True: if bucketrtn is False and pathrtn is True: