ansible/cloud/amazon
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
..
__init__.py added __init__.py to new cloud subcategories so builds work again 2014-11-05 11:07:19 -05:00
_ec2_ami_search.py Update module "imports" to new style 2015-05-18 11:59:20 -07:00
cloudformation.py Merge pull request #678 from Jimdo/handle-cfn-rollback-failure 2015-05-27 22:45:33 +05:30
ec2.py Do instance update after add tags to instance. 2015-05-25 09:25:11 +08:00
ec2_ami.py minor doc fixes, set version added for new tags: parameter 2015-05-01 09:58:27 -04:00
ec2_ami_find.py fixes example documenation 2015-05-21 09:07:23 -04:00
ec2_asg.py Fixed typos 2015-05-04 12:54:03 +01:00
ec2_eip.py Use existing ec2_eip address if already associated 2015-05-05 11:37:47 +01:00
ec2_elb.py issue #994: use HAS_BOTO to determine if import was successful: 2015-04-01 17:31:10 -06:00
ec2_elb_lb.py adding stickiness support to ec2_elb_lb.py 2015-05-14 22:30:45 -07:00
ec2_facts.py Merge pull request #260 from willthames/aws_frankfurt 2014-12-22 08:47:27 -05:00
ec2_group.py Added support for foreign security groups (Fixes: #373) 2015-05-22 12:34:41 +02:00
ec2_key.py issue #994: use HAS_BOTO to determine if import was successful: 2015-04-01 17:31:10 -06:00
ec2_lc.py issue #994: use HAS_BOTO to determine if import was successful: 2015-04-01 17:31:10 -06:00
ec2_metric_alarm.py Fixed typos 2015-05-04 12:54:03 +01:00
ec2_scaling_policy.py Fixed typos 2015-05-04 12:54:03 +01:00
ec2_snapshot.py issue #994: use HAS_BOTO to determine if import was successful: 2015-04-01 17:31:10 -06:00
ec2_tag.py issue #994: use HAS_BOTO to determine if import was successful: 2015-04-01 17:31:10 -06:00
ec2_vol.py [ec2_vol] Find or Create volume by name 2015-05-12 07:06:37 +02:00
ec2_vpc.py Output the Internet Gatewoy id directly instead of in a dict. 2015-06-01 15:52:39 -07:00
elasticache.py doc fix 2015-05-13 15:58:07 -04:00
rds.py Fix for issue #1332 - when instance is has finished deleting and get_db_instance returns None, exit gracefully 2015-05-26 15:12:00 +10:00
rds_param_group.py Fix Issue #1216 (ValueError with Amazon RDS) 2015-05-05 10:53:17 -03:00
rds_subnet_group.py Fix typo in rds_subnet_group.py 2015-04-06 10:00:17 -04:00
route53.py Update route53.py 2015-06-01 14:53:42 -07:00
s3.py feature pull request: catch and retry recoverable errors 2015-06-01 16:09:20 -07:00