mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Warn that NULL SRV records are unsupported in DNS Made Easy provider
This commit is contained in:
@@ -284,6 +284,30 @@ class DnsMadeEasyProvider(BaseProvider):
|
||||
len(zone.records) - before, exists)
|
||||
return exists
|
||||
|
||||
def supports(self, record):
|
||||
# DNS Made Easy does not support empty/NULL SRV records
|
||||
#
|
||||
# Attempting to sync such a record would generate the following error
|
||||
#
|
||||
# octodns.provider.dnsmadeeasy.DnsMadeEasyClientBadRequest:
|
||||
# - Record value may not be a standalone dot.
|
||||
#
|
||||
# Skip the record and continue
|
||||
if record._type == "SRV":
|
||||
if 'value' in record.data:
|
||||
targets = (record.data['value']['target'],)
|
||||
else:
|
||||
targets = [value['target'] for value in record.data['values']]
|
||||
|
||||
if "." in targets:
|
||||
self.log.warning(
|
||||
'supports: unsupported %s record with target (%s)',
|
||||
record._type, targets
|
||||
)
|
||||
return False
|
||||
|
||||
return record._type in self.SUPPORTS
|
||||
|
||||
def _params_for_multiple(self, record):
|
||||
for value in record.values:
|
||||
yield {
|
||||
|
||||
@@ -134,7 +134,7 @@ class TestDnsMadeEasyProvider(TestCase):
|
||||
plan = provider.plan(self.expected)
|
||||
|
||||
# No root NS, no ignored, no excluded, no unsupported
|
||||
n = len(self.expected.records) - 6
|
||||
n = len(self.expected.records) - 8
|
||||
self.assertEquals(n, len(plan.changes))
|
||||
self.assertEquals(n, provider.apply(plan))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user