mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Merge branch 'master' into python3-no-six
This commit is contained in:
@@ -457,7 +457,7 @@ class AzureProvider(BaseProvider):
|
|||||||
'''
|
'''
|
||||||
SUPPORTS_GEO = False
|
SUPPORTS_GEO = False
|
||||||
SUPPORTS_DYNAMIC = True
|
SUPPORTS_DYNAMIC = True
|
||||||
SUPPORTS_MUTLIVALUE_PTR = True
|
SUPPORTS_MULTIVALUE_PTR = True
|
||||||
SUPPORTS = set(('A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SRV',
|
SUPPORTS = set(('A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SRV',
|
||||||
'TXT'))
|
'TXT'))
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ class BaseProvider(BaseSource):
|
|||||||
record.dynamic = None
|
record.dynamic = None
|
||||||
desired.add_record(record, replace=True)
|
desired.add_record(record, replace=True)
|
||||||
elif record._type == 'PTR' and len(record.values) > 1 and \
|
elif record._type == 'PTR' and len(record.values) > 1 and \
|
||||||
not self.SUPPORTS_MUTLIVALUE_PTR:
|
not self.SUPPORTS_MULTIVALUE_PTR:
|
||||||
# replace with a single-value copy
|
# replace with a single-value copy
|
||||||
msg = \
|
msg = \
|
||||||
f'multi-value PTR records not supported for {record.fqdn}'
|
f'multi-value PTR records not supported for {record.fqdn}'
|
||||||
|
@@ -304,7 +304,7 @@ class Ns1Provider(BaseProvider):
|
|||||||
'''
|
'''
|
||||||
SUPPORTS_GEO = True
|
SUPPORTS_GEO = True
|
||||||
SUPPORTS_DYNAMIC = True
|
SUPPORTS_DYNAMIC = True
|
||||||
SUPPORTS_MUTLIVALUE_PTR = True
|
SUPPORTS_MULTIVALUE_PTR = True
|
||||||
SUPPORTS = set(('A', 'AAAA', 'ALIAS', 'CAA', 'CNAME', 'MX', 'NAPTR',
|
SUPPORTS = set(('A', 'AAAA', 'ALIAS', 'CAA', 'CNAME', 'MX', 'NAPTR',
|
||||||
'NS', 'PTR', 'SPF', 'SRV', 'TXT', 'URLFWD'))
|
'NS', 'PTR', 'SPF', 'SRV', 'TXT', 'URLFWD'))
|
||||||
|
|
||||||
|
@@ -104,7 +104,7 @@ class YamlProvider(BaseProvider):
|
|||||||
'''
|
'''
|
||||||
SUPPORTS_GEO = True
|
SUPPORTS_GEO = True
|
||||||
SUPPORTS_DYNAMIC = True
|
SUPPORTS_DYNAMIC = True
|
||||||
SUPPORTS_MUTLIVALUE_PTR = True
|
SUPPORTS_MULTIVALUE_PTR = True
|
||||||
SUPPORTS = set(('A', 'AAAA', 'ALIAS', 'CAA', 'CNAME', 'DNAME', 'LOC', 'MX',
|
SUPPORTS = set(('A', 'AAAA', 'ALIAS', 'CAA', 'CNAME', 'DNAME', 'LOC', 'MX',
|
||||||
'NAPTR', 'NS', 'PTR', 'SSHFP', 'SPF', 'SRV', 'TXT',
|
'NAPTR', 'NS', 'PTR', 'SSHFP', 'SPF', 'SRV', 'TXT',
|
||||||
'URLFWD'))
|
'URLFWD'))
|
||||||
|
@@ -8,7 +8,7 @@ from __future__ import absolute_import, division, print_function, \
|
|||||||
|
|
||||||
class BaseSource(object):
|
class BaseSource(object):
|
||||||
|
|
||||||
SUPPORTS_MUTLIVALUE_PTR = False
|
SUPPORTS_MULTIVALUE_PTR = False
|
||||||
|
|
||||||
def __init__(self, id):
|
def __init__(self, id):
|
||||||
self.id = id
|
self.id = id
|
||||||
|
@@ -21,7 +21,7 @@ class HelperProvider(BaseProvider):
|
|||||||
log = getLogger('HelperProvider')
|
log = getLogger('HelperProvider')
|
||||||
|
|
||||||
SUPPORTS = set(('A', 'PTR'))
|
SUPPORTS = set(('A', 'PTR'))
|
||||||
SUPPORTS_MUTLIVALUE_PTR = False
|
SUPPORTS_MULTIVALUE_PTR = False
|
||||||
SUPPORTS_DYNAMIC = False
|
SUPPORTS_DYNAMIC = False
|
||||||
|
|
||||||
id = 'test'
|
id = 'test'
|
||||||
@@ -238,8 +238,8 @@ class TestBaseProvider(TestCase):
|
|||||||
def test_process_desired_zone(self):
|
def test_process_desired_zone(self):
|
||||||
provider = HelperProvider('test')
|
provider = HelperProvider('test')
|
||||||
|
|
||||||
# SUPPORTS_MUTLIVALUE_PTR
|
# SUPPORTS_MULTIVALUE_PTR
|
||||||
provider.SUPPORTS_MUTLIVALUE_PTR = False
|
provider.SUPPORTS_MULTIVALUE_PTR = False
|
||||||
zone1 = Zone('unit.tests.', [])
|
zone1 = Zone('unit.tests.', [])
|
||||||
record1 = Record.new(zone1, 'ptr', {
|
record1 = Record.new(zone1, 'ptr', {
|
||||||
'type': 'PTR',
|
'type': 'PTR',
|
||||||
@@ -252,7 +252,7 @@ class TestBaseProvider(TestCase):
|
|||||||
record2 = list(zone2.records)[0]
|
record2 = list(zone2.records)[0]
|
||||||
self.assertEqual(len(record2.values), 1)
|
self.assertEqual(len(record2.values), 1)
|
||||||
|
|
||||||
provider.SUPPORTS_MUTLIVALUE_PTR = True
|
provider.SUPPORTS_MULTIVALUE_PTR = True
|
||||||
zone2 = provider._process_desired_zone(zone1.copy())
|
zone2 = provider._process_desired_zone(zone1.copy())
|
||||||
record2 = list(zone2.records)[0]
|
record2 = list(zone2.records)[0]
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
Reference in New Issue
Block a user