You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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
11 years ago
..
__init__.py added __init__.py to new cloud subcategories so builds work again 11 years ago
_ec2_ami_search.py Update module "imports" to new style 11 years ago
cloudformation.py Merge pull request #678 from Jimdo/handle-cfn-rollback-failure 11 years ago
ec2.py Do instance update after add tags to instance. 11 years ago
ec2_ami.py minor doc fixes, set version added for new tags: parameter 11 years ago
ec2_ami_find.py fixes example documenation 11 years ago
ec2_asg.py Fixed typos 11 years ago
ec2_eip.py Use existing ec2_eip address if already associated 11 years ago
ec2_elb.py issue #994: use HAS_BOTO to determine if import was successful: 11 years ago
ec2_elb_lb.py adding stickiness support to ec2_elb_lb.py 11 years ago
ec2_facts.py Merge pull request #260 from willthames/aws_frankfurt 11 years ago
ec2_group.py Added support for foreign security groups (Fixes: #373) 11 years ago
ec2_key.py issue #994: use HAS_BOTO to determine if import was successful: 11 years ago
ec2_lc.py issue #994: use HAS_BOTO to determine if import was successful: 11 years ago
ec2_metric_alarm.py Fixed typos 11 years ago
ec2_scaling_policy.py Fixed typos 11 years ago
ec2_snapshot.py issue #994: use HAS_BOTO to determine if import was successful: 11 years ago
ec2_tag.py issue #994: use HAS_BOTO to determine if import was successful: 11 years ago
ec2_vol.py [ec2_vol] Find or Create volume by name 11 years ago
ec2_vpc.py Output the Internet Gatewoy id directly instead of in a dict. 11 years ago
elasticache.py doc fix 11 years ago
rds.py Fix for issue #1332 - when instance is has finished deleting and get_db_instance returns None, exit gracefully 11 years ago
rds_param_group.py Fix Issue #1216 (ValueError with Amazon RDS) 11 years ago
rds_subnet_group.py Fix typo in rds_subnet_group.py 11 years ago
route53.py Update route53.py 11 years ago
s3.py feature pull request: catch and retry recoverable errors 11 years ago