1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Doc standardization/style

This commit is contained in:
Michael DeHaan 2013-06-01 12:09:04 -04:00
parent e38a83e1ca
commit e06ced89fb

View file

@ -53,7 +53,7 @@ options:
aliases: [] aliases: []
overwrite: overwrite:
description: description:
- force overwrite if a file with the same name already exists, values true/false/yes/no. Does not support files uploaded to s3 with multipart upload. - force overwrite if a file with the same name already exists. Does not support files uploaded to s3 with multipart upload.
required: false required: false
default: false default: false
version_added: "1.2" version_added: "1.2"
@ -103,11 +103,11 @@ def main():
path = dict(), path = dict(),
dest = dict(), dest = dict(),
state = dict(choices=['present', 'absent']), state = dict(choices=['present', 'absent']),
expiry = dict(default=600), expiry = dict(default=600, aliases=['expiration']),
s3_url = dict(aliases=['S3_URL']), s3_url = dict(aliases=['S3_URL']),
ec2_secret_key = dict(aliases=['EC2_SECRET_KEY']), ec2_secret_key = dict(aliases=['EC2_SECRET_KEY']),
ec2_access_key = dict(aliases=['EC2_ACCESS_KEY']), ec2_access_key = dict(aliases=['EC2_ACCESS_KEY']),
overwrite = dict(default="false", choices=BOOLEANS), overwrite = dict(default=False, type='bool'),
), ),
required_together=[ ['bucket', 'path', 'state'] ], required_together=[ ['bucket', 'path', 'state'] ],
) )
@ -120,7 +120,7 @@ def main():
s3_url = module.params.get('s3_url') s3_url = module.params.get('s3_url')
ec2_secret_key = module.params.get('ec2_secret_key') ec2_secret_key = module.params.get('ec2_secret_key')
ec2_access_key = module.params.get('ec2_access_key') ec2_access_key = module.params.get('ec2_access_key')
overwrite = module.boolean( module.params.get('overwrite') ) overwrite = module.params.get('overwrite')
# allow eucarc environment variables to be used if ansible vars aren't set # allow eucarc environment variables to be used if ansible vars aren't set
if not s3_url and 'S3_URL' in os.environ: if not s3_url and 'S3_URL' in os.environ:
@ -185,7 +185,7 @@ def main():
except s3.provider.storage_response_error, e: except s3.provider.storage_response_error, e:
module.fail_json(msg= str(e)) module.fail_json(msg= str(e))
if key_exists is True and overwrite is True: if key_exists is True and overwrite:
# Retrieve MD5 Checksums. # 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 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 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