module.exit_json(msg="Local and remote object are identical, ignoring. Use overwrite parameter to force.",changed=False)
else:
else:
key_exists=False
sum_matches=False
excepts3.provider.storage_response_error,e:
ifoverwriteisTrue:
module.fail_json(msg=str(e))
download_s3file(module,s3,bucket,obj,dest)
else:
ifkey_existsisTrueandoverwrite:
module.fail_json(msg="WARNING: Checksums do not match. Use overwrite parameter to force download.",failed=True)
# Retrieve MD5 Checksums.
md5_remote=key_check.etag[1:-1]# Strip Quotation marks from etag: https://code.google.com/p/boto/issues/detail?id=391
etag_multipart=md5_remote.find('-')!=-1# Find out if this is a multipart upload -> etag is not md5: https://forums.aws.amazon.com/message.jspa?messageID=222158
ifetag_multipartisTrue:
module.fail_json(msg="Files uploaded with multipart to s3 are not supported with checksum. They do not contain a valid md5 checksum, use overwrite=no instead.")