Browse Source

Added detection for edge case that could happen with existing records where the value is '@'

TransIP allows '@' as value to alias the root record.
'@' was on populate appended with the zone, which trigger an unneeded update.
'@' => '@.example.com.' -> 'example.com'
This fix will stop the unneeded update
pull/405/head
Maikel Poot 6 years ago
parent
commit
59e44b865c
2 changed files with 8 additions and 1 deletions
  1. +6
    -1
      octodns/provider/transip.py
  2. +2
    -0
      tests/test_octodns_provider_transip.py

+ 6
- 1
octodns/provider/transip.py View File

@ -218,7 +218,12 @@ class TransipProvider(BaseProvider):
def _parse_to_fqdn(self, value):
if (value[-1] != '.'):
# TransIP allows '@' as value to alias the root record.
# this provider won't set an '@' value, but can be an existing record
if value == self.ROOT_RECORD:
value = self._currentZone.name
if value[-1] != '.':
self.log.debug('parseToFQDN: changed %s to %s', value,
'{}.{}'.format(value, self._currentZone.name))
value = '{}.{}'.format(value, self._currentZone.name)


+ 2
- 0
tests/test_octodns_provider_transip.py View File

@ -188,6 +188,8 @@ N4OiVz1I3rbZGYa396lpxO6ku8yCglisL1yrSP6DdEUp66ntpKVd
provider._parse_to_fqdn("www.unit.tests."))
self.assertEquals("www.sub.sub.sub.unit.tests.",
provider._parse_to_fqdn("www.sub.sub.sub"))
self.assertEquals("unit.tests.",
provider._parse_to_fqdn("@"))
# Happy Plan - Even if the zone has no records the zone should exist
provider = TransipProvider('test', 'unittest', self.bogus_key)


Loading…
Cancel
Save