Browse Source

Merge remote-tracking branch 'origin/master' into root-ns-support

pull/876/head
Ross McFarland 4 years ago
parent
commit
9454f622f9
No known key found for this signature in database GPG Key ID: 943B179E15D3B22A
3 changed files with 16 additions and 2 deletions
  1. +2
    -0
      CHANGELOG.md
  2. +3
    -2
      octodns/record/__init__.py
  3. +11
    -0
      tests/test_octodns_record.py

+ 2
- 0
CHANGELOG.md View File

@ -22,6 +22,8 @@
* _AggregateTarget has more complete handling of SUPPORTS* functionality,
mostly applicable for the compare operation.
* Fix null MX record validation error introduced in 0.9.15, `.` is again
allowed as a valid `exchange` value.
## v0.9.15 - 2022-02-07 - Where have all the providers gone?


+ 3
- 2
octodns/record/__init__.py View File

@ -1090,8 +1090,9 @@ class MxValue(EqualityTupleMixin):
reasons.append(f'invalid preference "{value["preference"]}"')
exchange = None
try:
exchange = value.get('exchange', None) or value['value']
if not FQDN(str(exchange), allow_underscores=True).is_valid:
exchange = str(value.get('exchange', None) or value['value'])
if exchange != '.' and \
not FQDN(exchange, allow_underscores=True).is_valid:
reasons.append(f'Invalid MX exchange "{exchange}" is not '
'a valid FQDN.')
elif not exchange.endswith('.'):


+ 11
- 0
tests/test_octodns_record.py View File

@ -2717,6 +2717,17 @@ class TestRecordValidation(TestCase):
self.assertEqual(['Invalid MX exchange "100 foo.bar.com." is not a '
'valid FQDN.'], ctx.exception.reasons)
# exchange can be a single `.`
record = Record.new(self.zone, '', {
'type': 'MX',
'ttl': 600,
'value': {
'preference': 0,
'exchange': '.'
}
})
self.assertEqual('.', record.values[0].exchange)
def test_NXPTR(self):
# doesn't blow up
Record.new(self.zone, '', {


Loading…
Cancel
Save