Browse Source

Merge pull request #97 from github/route53-max-attempts

Add support for increasing Route53 retries
pull/105/head
Ross McFarland 8 years ago
committed by GitHub
parent
commit
a7923f4805
3 changed files with 26 additions and 9 deletions
  1. +11
    -2
      octodns/provider/route53.py
  2. +7
    -7
      requirements.txt
  3. +8
    -0
      tests/test_octodns_provider_route53.py

+ 11
- 2
octodns/provider/route53.py View File

@ -6,6 +6,7 @@ from __future__ import absolute_import, division, print_function, \
unicode_literals
from boto3 import client
from botocore.config import Config
from collections import defaultdict
from incf.countryutils.transformations import cca_to_ctca2
from uuid import uuid4
@ -229,14 +230,22 @@ class Route53Provider(BaseProvider):
HEALTH_CHECK_VERSION = '0000'
def __init__(self, id, access_key_id, secret_access_key, max_changes=1000,
*args, **kwargs):
client_max_attempts=None, *args, **kwargs):
self.max_changes = max_changes
self.log = logging.getLogger('Route53Provider[{}]'.format(id))
self.log.debug('__init__: id=%s, access_key_id=%s, '
'secret_access_key=***', id, access_key_id)
super(Route53Provider, self).__init__(id, *args, **kwargs)
config = None
if client_max_attempts is not None:
self.log.info('__init__: setting max_attempts to %d',
client_max_attempts)
config = Config(retries={'max_attempts': client_max_attempts})
self._conn = client('route53', aws_access_key_id=access_key_id,
aws_secret_access_key=secret_access_key)
aws_secret_access_key=secret_access_key,
config=config)
self._r53_zones = None
self._r53_rrsets = {}


+ 7
- 7
requirements.txt View File

@ -3,19 +3,19 @@
PyYaml==3.12
azure-mgmt-dns==1.0.1
azure-common==1.1.6
boto3==1.4.4
botocore==1.5.4
boto3==1.4.6
botocore==1.6.0
dnspython==1.15.0
docutils==0.13.1
docutils==0.14
dyn==1.7.10
futures==3.0.5
futures==3.1.1
incf.countryutils==1.0
ipaddress==1.0.18
jmespath==0.9.0
jmespath==0.9.3
msrestazure==0.4.10
natsort==5.0.3
nsone==0.9.14
python-dateutil==2.6.0
python-dateutil==2.6.1
requests==2.13.0
s3transfer==0.1.10
six==1.10.0
six==1.10.0

+ 8
- 0
tests/test_octodns_provider_route53.py View File

@ -1232,6 +1232,14 @@ class TestRoute53Provider(TestCase):
'Type': 'TXT',
}))
def test_client_max_attempts(self):
provider = Route53Provider('test', 'abc', '123',
client_max_attempts=42)
# NOTE: this will break if boto ever changes the impl details...
self.assertEquals(43, provider._conn.meta.events
._unique_id_handlers['retry-config-route53']
['handler']._checker.__dict__['_max_attempts'])
class TestRoute53Records(TestCase):


Loading…
Cancel
Save