Commit graph

68 commits

Author SHA1 Message Date
Javier M. Mellid
a88d6d9a53 Add s3_url requirement in doc when rgw support is enabled in s3.py
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
2016-06-21 10:53:47 +02:00
Javier M. Mellid
a52ff221f7 Add proper version_added for rgw option in s3.py
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
2016-06-21 10:53:41 +02:00
Javier M. Mellid
b1724344d5 Add Ceph RGW S3 compatibility
Ceph Object Gateway (Ceph RGW) is an object storage interface built on top of
librados to provide applications with a RESTful gateway to Ceph Storage
Clusters:

http://docs.ceph.com/docs/master/radosgw/

This patch adds the required bits to use the RGW S3 RESTful API properly.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
2016-06-21 10:53:36 +02:00
codemeup @ Work
7314cc3867 Fixing error exception handling for python3. Does not need to be compa… (#3840)
* Fixing error exception handling for python. Does not need to be compatible with Python2.4 b/c boto is Python 2.6 and above.

* Fixing error exception handling for python. Does not need to be compatible with Python2.4 b/c boto is Python 2.6 and above.

* Fixing compile time errors IRT error exception handling for Python 3.5.
This does not need to be compatible with Python2.4 b/c Boto is Python 2.6 and above.
2016-06-02 12:56:48 -07:00
Doug Luce
ec0f2113e0 Fix S3 unavailable region error
This is to address this error:

  fatal: [site]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to connect to S3: Region  does not seem to be available for awsmodule boto.s3. If the region definitely exists, you may need to upgrade boto or extend with endpoints_path"}

Commit 0dd58e9 changed the logic so an exception is thrown (by
`connect_to_aws`) before the `s3 is None` check is performed. This
changes the `None` check to a catch so the old logic can compensate.
2016-05-24 20:37:12 -07:00
Brian Coca
3381e8f76e clarified docs on overwrite 2016-04-28 17:13:56 -04:00
Ted Timmons
a87171e280 fix typo in documentation
let's -> lets
2016-03-18 12:03:14 -07:00
Brian Coca
6a48f2207a corrected typo on aws connection arguments var 2016-03-07 10:39:24 -05:00
Toshio Kuratomi
1c4da434c7 Merge pull request #2421 from willthames/ec2_fix_vpc_security_token
Use connect_to_aws where possible
2016-03-04 11:06:22 -08:00
Matt Martz
c7845456a6 Various simple linting type cleanups on modules 2016-02-16 15:58:44 -06:00
Brian Coca
fbaf4fb628 Merge pull request #2746 from ferrants/patch-2
updated s3 module documentation
2016-01-18 11:17:09 -05:00
Brian Coca
1a298f7948 updated s3 docs to reflect mode choices
fixes #2318
2016-01-15 00:44:29 -05:00
Matt Ferrante
2c75e72e83 updated s3 module documentation 2015-12-30 20:04:41 -05:00
Will Thames
0dd58e9326 Use connect_to_aws where possible
`connect_to_aws` fixes a bug with security tokens in AWS.
Modules should use that rather than calling
`boto.x.connect_to_region`
2015-11-06 19:05:01 +10:00
Greg DeKoenigsberg
344cf5fc0e Remove @ralph-tice from maintainership per his request 2015-10-28 14:47:03 -04:00
Val Komarov
986d4064e9 Remove duplicate logic 2015-10-14 15:54:04 -04:00
Frank van Tol
a7667fcaf2 Update s3.py
We are copying from S3,  the bucket is the source, not the target.
2015-09-14 15:57:48 +02:00
Taneli Lepp
15f4b59619 Added option to set multiple ACLs for S3 objects. Also verifies the
selected permissions against Boto's canned ACL strings list.
2015-09-08 20:00:14 +03:00
Benno Joy
b5db274362 Merge pull request #1940 from jcowley/s3-permissions
Add support for S3 canned permissions. resolves #1939
2015-09-01 09:15:15 +05:30
Till Backhaus
39e7e05a8d Delete dead and broken code 2015-08-24 20:06:53 +02:00
Jason Cowley
8215aad3b3 Add support for S3 canned permissions. resolves #1939 2015-08-19 11:40:07 -07:00
James Cammarata
79f21c6ec9 Fix missing params to download_s3file in s3 2015-07-30 14:49:45 -04:00
James Cammarata
4c4e978360 Fixing s3 failures when bucket names contain dots 2015-07-30 13:47:01 -04:00
Brian Coca
92f32a0253 added version added to headers in s3 2015-07-28 14:50:39 -04:00
Brian Coca
4b78b5597f Merge pull request #160 from acaire/s3-headers
S3 headers
2015-07-28 14:48:51 -04:00
Feanil Patel
22461e335a If overwrite is set, download eagerly.
If the we are going to overwrite the file anyway,
there is no need to do any checksums locally or
grab the remote etag.
2015-07-24 10:44:05 -04:00
khassen
5f2b365faa Use the common/shared MD5 function. 2015-07-23 13:58:43 -07:00
ayush
3f7313cc43 Updated doc strings so each character isn't considered a line 2015-07-20 17:05:10 -07:00
Apoorva Kulkarni
c0e4c50eeb s3 module: Add missing version tag to "encrypt" parameter 2015-07-10 14:56:34 -07:00
Ash Caire
3ccf2e8a86 add headers param to s3 uploads 2015-06-30 23:04:15 +10:00
Toshio Kuratomi
406402bb26 Merge pull request #332 from proby/add-s3-list
Add support for listing keys in a specific S3 bucket
2015-06-30 04:58:58 -07:00
Patrick Roby
e90d02c35c iterate through all keys in a more pythonic manner 2015-06-25 10:37:17 -07:00
Patrick Roby
8ba96aaf4b update documentation, adding new params 2015-06-25 10:36:07 -07:00
Toshio Kuratomi
d824a7a9f5 Merge pull request #255 from SDFE/s3_connect_params
Use aws connect calls that allow boto profile use
2015-06-25 08:23:15 -07:00
Patrick Roby
00322c43fc Add support for listing keys in a specific S3 bucket
Includes support for specifying a prefix, marker, and/or max_keys. Returns a list of key names (as strings).
2015-06-24 12:18:23 -07:00
Greg DeKoenigsberg
28a869a030 Updating cloud modules with proper github author information 2015-06-15 14:41:22 -04:00
Tyler Cross
de617bb3ae Get specific object version with S3 module.
- allow specifying version for mode=get and mode=getstr
- when version specified doesn't exist give an error message that indicates so
2015-06-15 07:43:29 -04:00
Brian Coca
acfa1b4c39 Merge pull request #1464 from qrtt1/devel
Prevent s3 module getting the memory-error from uploading or downloading a large file
2015-06-12 13:53:50 -04:00
Bruce Pennypacker
51bc602f42 Added delobj command to delete an object within a bucket 2015-06-11 13:43:15 +00:00
Ching Yi, Chan
1517ae8ab2 Refactoring for easier to read 2015-06-05 23:29:11 +08:00
Ching Yi, Chan
ed5ea7e921 Prevent memory-error from a large file 2015-06-04 14:28:57 +08:00
tedder
b138411671 feature pull request: catch and retry recoverable errors
boto can throw SSLError when timeouts occur (among other SSL errors). Catch these so proper JSON can be returned, and also add the ability to retry the operation.

There's an open issue in boto for this: https://github.com/boto/boto/issues/2409

Here's a sample stacktrace that inspired me to work on this. I'm on 1.7, but there's no meaningful differences in the 1.8 release that would affect this. I've added line breaks to the trace for readability.

    failed to parse: Traceback (most recent call last):
      File "/home/ubuntu/.ansible/tmp/ansible-tmp-1419895753.17-160808281985012/s3", line 2031, in <module> main()
      File "/home/ubuntu/.ansible/tmp/ansible-tmp-1419895753.17-160808281985012/s3", line 353, in main download_s3file(module, s3, bucket, obj, dest)
      File "/home/ubuntu/.ansible/tmp/ansible-tmp-1419895753.17-160808281985012/s3", line 234, in download_s3file key.get_contents_to_filename(dest)
      File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 1665, in get_contents_to_filename response_headers=response_headers)
      File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 1603, in get_contents_to_file response_headers=response_headers)
      File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 1435, in get_file query_args=None)
      File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 1488, in _get_file_internal for bytes in self:
      File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 368, in next data = self.resp.read(self.BufferSize)
      File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 416, in read return httplib.HTTPResponse.read(self, amt)
      File "/usr/lib/python2.7/httplib.py", line 567, in read s = self.fp.read(amt)
      File "/usr/lib/python2.7/socket.py", line 380, in read data = self._sock.recv(left)
      File "/usr/lib/python2.7/ssl.py", line 341, in recv return self.read(buflen)
      File "/usr/lib/python2.7/ssl.py", line 260, in read return self._sslobj.read(len) ssl.SSLError: The read operation timed out
2015-06-01 16:09:20 -07:00
Benno Joy
4e206e3790 Fixes issue 1197 for s3 module, where the file gets downloaded even if checksums match 2015-06-01 15:52:39 -07:00
billwanjohi
40eef6c3ec s3 put: add support for server-side encryption
- added 'encrypt' boolean option
- reordered module options alphanumerically
2015-05-27 16:00:01 +00:00
Toshio Kuratomi
5f9592248a Minor fixups found during review of #582 2015-05-27 07:03:29 -07:00
Toshio Kuratomi
dcc04f9505 Merge branch 's3_retry' of https://github.com/stansonhealth/ansible-modules-core into stansonhealth-s3_retry
Conflicts:
	cloud/amazon/s3.py
2015-05-27 06:55:33 -07:00
Benno Joy
ed62de6d3c Fixes issue 1197 for s3 module, where the file gets downloaded even if checksums match 2015-05-14 09:03:50 +05:30
Brian Coca
0e23dd6c55 avoid exception when boto is not available 2015-04-24 11:03:36 -04:00
Dan Abel
c5f5dfd8a0 use aws connect calls that allow boto profile use 2015-04-02 10:51:18 +01:00
steenzout
d960dc1584 issue #994: use HAS_BOTO to determine if import was successful:
- removed import of sys module.
- HAS_BOTO constant to check if import was successful.
- trigger a failure when import fails.
- removed unnecessary imports.
2015-04-01 17:31:10 -06:00