Browse Source

Fix partially re-used fallback chain

pull/734/head
Viranch Mehta 5 years ago
parent
commit
4848246712
No known key found for this signature in database GPG Key ID: D83D1392AE9F93B4
2 changed files with 16 additions and 3 deletions
  1. +2
    -2
      octodns/provider/azuredns.py
  2. +14
    -1
      tests/test_octodns_provider_azuredns.py

+ 2
- 2
octodns/provider/azuredns.py View File

@ -837,8 +837,8 @@ class AzureProvider(BaseProvider):
pool['fallback'] = pool_name pool['fallback'] = pool_name
if pool_name in pools: if pool_name in pools:
# we've already populated the pool
continue
# we've already populated this and subsequent pools
break
# populate the pool from Weighted profile # populate the pool from Weighted profile
# these should be leaf node entries with no further nesting # these should be leaf node entries with no further nesting


+ 14
- 1
tests/test_octodns_provider_azuredns.py View File

@ -1687,6 +1687,12 @@ class TestAzureDnsProvider(TestCase):
'value': 'default.unit.tests.', 'value': 'default.unit.tests.',
'dynamic': { 'dynamic': {
'pools': { 'pools': {
'sto': {
'values': [
{'value': 'sto.unit.tests.'},
],
'fallback': 'iad',
},
'iad': { 'iad': {
'values': [ 'values': [
{'value': 'iad.unit.tests.'}, {'value': 'iad.unit.tests.'},
@ -1702,13 +1708,14 @@ class TestAzureDnsProvider(TestCase):
'rules': [ 'rules': [
{'geos': ['EU'], 'pool': 'iad'}, {'geos': ['EU'], 'pool': 'iad'},
{'geos': ['EU-GB'], 'pool': 'lhr'}, {'geos': ['EU-GB'], 'pool': 'lhr'},
{'geos': ['EU-SE'], 'pool': 'sto'},
{'pool': 'lhr'}, {'pool': 'lhr'},
], ],
} }
}) })
profiles = provider._generate_traffic_managers(record) profiles = provider._generate_traffic_managers(record)
self.assertEqual(len(profiles), 3)
self.assertEqual(len(profiles), 4)
self.assertTrue(_profile_is_match(profiles[-1], Profile( self.assertTrue(_profile_is_match(profiles[-1], Profile(
name='foo--unit--tests', name='foo--unit--tests',
traffic_routing_method='Geographic', traffic_routing_method='Geographic',
@ -1728,6 +1735,12 @@ class TestAzureDnsProvider(TestCase):
target_resource_id=profiles[1].id, target_resource_id=profiles[1].id,
geo_mapping=['GB', 'WORLD'], geo_mapping=['GB', 'WORLD'],
), ),
Endpoint(
name='rule-sto',
type=nested,
target_resource_id=profiles[2].id,
geo_mapping=['SE'],
),
], ],
))) )))


Loading…
Cancel
Save