Browse Source

Handle MX preference of 0

pull/173/head
Ross McFarland 8 years ago
parent
commit
af435c3130
No known key found for this signature in database GPG Key ID: 61C10C4FC8FE4A89
2 changed files with 5 additions and 2 deletions
  1. +4
    -1
      octodns/record.py
  2. +1
    -1
      tests/test_octodns_record.py

+ 4
- 1
octodns/record.py View File

@ -506,7 +506,10 @@ class MxValue(object):
def _validate_value(cls, value):
reasons = []
try:
int(value.get('preference', None) or value['priority'])
try:
int(value['preference'])
except KeyError:
int(value['priority'])
except KeyError:
reasons.append('missing preference')
except ValueError:


+ 1
- 1
tests/test_octodns_record.py View File

@ -345,7 +345,7 @@ class TestRecord(TestCase):
self.assertEquals(a_data, a.data)
b_value = {
'preference': 12,
'preference': 0,
'exchange': 'smtp3.',
}
b_data = {'ttl': 30, 'value': b_value}


Loading…
Cancel
Save